narjis Posted July 25, 2012 Share Posted July 25, 2012 I'm trying to send input data to some php file but it is not showing correct results. here is my jquery script. $(document).ready(function(){ $('#existing_txt').load('ajaxLoad.php'); $("#frm").submit(function(){ $.post('ajaxChat.php',$('#frm').serialize(), function(data) { alert(data); //$('#existing_txt').html(data); }); }); }); jaxLoad.php is workig fine but data is not being posted to ajaxChat.php wher i'm gim(#frm).submit(); Here is my html <div id="existing_txt"> </div> <form id="frm"> Enter the text to be saved as chat<input type="text" name="chatText" /><br /> <input type="submit" value="Save Text" /> </form> Link to comment https://forums.phpfreaks.com/topic/266202-jquery-not-showing-correct-results/ Share on other sites More sharing options...
sunfighter Posted July 28, 2012 Share Posted July 28, 2012 Your html form needs to look like this: <form id="frm" action="ajaxChat.php"> Link to comment https://forums.phpfreaks.com/topic/266202-jquery-not-showing-correct-results/#findComment-1365059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.