callback - Ajax: Append data in input value instead of div -


this ajax function works fine, change place result needs shown

<script type="text/javascript">    function submitform1() { var form1 = document.myform1; var datastring1 = $(form1).serialize(); $.ajax({ type:'get', url:'file.php', cache: false, data: datastring1, success: function(data){ $('#results').html(data); } }); </script> 

html

<input type="hidden" name="place" id="place" value="//append data here"> <div id="result"><div> 

i need have result in value=" " after ajax call back. way this?

try use $('#result').html(data); instead $('#results').html(data); , forget close function

 function submitform1() {     var form1 = document.myform1;     var datastring1 = $(form1).serialize();     $.ajax({        type: 'get',        url: 'file.php',        cache: false,        data: datastring1,        success: function(data) {          $('#result').html(data);        }      });  } 

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 -