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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -