I have a form that sends out to php which have a few text fields and image fields. But my javascript is not receiving the echo back from php. It redirects me to a php with the data echoed on there. Wondering why my javascript does that. Thanks for your time!
<script type="text/javascript" >
$("button#signinbutton").click(function() {
if ($("#list").val() == "") {
$("p#result").html("Please enter both userna");
} else {
$.post($("#submitform").attr("action"), $("#submitform").serializeArray(), function(data) {
var reply = data.replace(/\s+/, "");
if($.trim(data) == 'success'){
location.replace("account.html")
}
else
{
$("p#result").html(data);
}
});
}
});
$("#submitform").submit(function() {
return false;
});
</script>