forms - Ajax call back: Return variable as input value -
after ajax call need echo out variable value of hidden field.
html
<form ajax1> <input name="place" value="milan"> <input name=submit onclick="return submitform1()"> </form> <form ajax2> <input type="hidden" value="$place"> <input name="filter"> <input name=submit onclick="return submitform2()"> </form> <div id="result"></div>
ajax call
function submitform1() { var form1 = document.myform1; var datastring1 = $(form2).serialize(); $.ajax({ type:'get', url:'query.php', cache: false, data: datastring1, success: function(data){ $('#results').html(data); } }); return false; }
php
<? $place= $_get['place'] //do stuffs ?>
it works perfectly, need add function echo out $place in value=" " of form ajax2
any appreciated
Comments
Post a Comment