Issue with jQuery .submit()
Posted
by
d.lanza38
on Stack Overflow
See other posts from Stack Overflow
or by d.lanza38
Published on 2012-09-17T15:34:59Z
Indexed on
2012/09/17
15:37 UTC
Read the original article
Hit count: 113
I'm having an issue submitting a form with the jquery .submit();
I don't have any elements on my page with a name of name="submit" or name="Submit", same goes for id's.
My bit of jQuery code is as follows:
$(document).ready(function () {
$(document).on('click', "#appSubmit",function(e){
e.preventDefault();
var value = $("#time").val();
if(value == "--"){
$( "#err-time" ).dialog( "open" );
}else{
alert("1");
var dummy = $("#appSubmit").val();
alert(dummy);
$("#appSubmit").submit();
alert("2");
}
});
});
All of the alerts work properly, even the alert(dummy);
prints out the correct value. The alert("2");
prints out, so it isn't even breaking on the $("#appSubmit").submit();
My submit button is
<input type="submit" name="appSubmit" id="appSubmit" value="Apply">
Any thoughts would be appreciated, thanks.
© Stack Overflow or respective owner