0

i know the question doesn't looks good but am not getting any idea because am new to here.my question is can we store the value of an input type in to an variable.here in this case

<input type="text" name="statustochange"> 

having an value now i want to store that value in to an variable with out submit or click

i got the value in to

name="statustochange"

from this way

<script type="text/javascript">
 $('.modal').modal({
    ready: function(modal, trigger) {
      modal.find('input[name="statustochange"]').val(trigger.data('status'))
     }
 });
</script>
user_777
  • 845
  • 1
  • 9
  • 25

2 Answers2

1

Try this:

<input type="text" name="statustochange" value="<?php echo $str; ?>">
santho
  • 366
  • 2
  • 16
0

Into a js variable? Use a onChange event!

Into a php variable? Use a js onChange event to trigger a postback in Ajax (invisible to the user)

Edit: More realavent link

m.nachury
  • 972
  • 8
  • 23