jquery form submit is not working

Spaziard

New Member
I want to validate the login page using jquery,ajax and php.But my jquery form submit function is not working.CAN ANY ONE HELP ME.this is my code \[quote\] HTML PART\[/quote\]\[code\]<form name="myform" id="myform" action="" method="post"><input type="text" name="uname" id="uname" placeholder="User Name" autofocus ><input type="password" name="pwd" id="pwd" placeholder="Password" ><input type="submit" name="submit" id="submit" value="http://stackoverflow.com/questions/13759347/login" ></form>\[/code\]\[quote\] JQUERY CODE\[/quote\]\[code\]$("#myform").submit(function(){ $("#msgbox").removeClass().addClass("messagebox").text("Validating").fadeIn("slow"); $.post("ajax_login.php{userName:$("#uname").val(),password:$("#pwd").val(),rand:Math.random()},function(data){ if(datahttp://stackoverflow.com/questions/13759347/=='yes'){ $("#msgbox").fadeTo(200,0.1,function(){ $(this).html("Logging in....').addClass("messageboxok').fadeTo("900,1,function(){ document.location='secure.php'; }); }); } else{ $("#msgbox").fadeTo(200,0.1,function(){ $(this).html("IncorrectDetails...").addClass('messageboxerror').fadeTo(900,1); }); } }); return false;}\[/code\]
 
Back
Top