javascript - Post a form using Jquery ajax and get the response -
javascript - Post a form using Jquery ajax and get the response -
i'm using code post form using jquery ajax . problem want create php code this:
if (isset($_post[''])) { // code here }
this javascript code:
$("button#submit").click( function() { if( $("#username").val() == "" || $("#password").val() == "" ) $("div#status").html("please come in email"); else $.post( $("#myform").attr("action"), $("#myform :input").serializearray(),function(data) { $("div#status").html(data); }); $("#myform").submit( function() { homecoming false; }); });
if tested code, , php section works fine, can not response in jquery, then, should check php code(it should this):
if (isset($_post[''])) { $data = ""; // code here fill $data echo $data; // actual response jquery interface. }
javascript php jquery ajax
Comments
Post a Comment