Using ASP.NET, why does this mean that the bassistance.de jQuery validation plugin prevents form submissions when using input type = "submit" elements rather than html button elements?
Validation is done using the html tag (type = "submit"), but the form is still submitted.
Is there a way to get the jQuery validation plugin to work with html button elements?
Quick example:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript">
$(document).ready(function () {
$("#form1").validate({
rules: {
txtFirstName: {
required: true
}
},
messages: {
txtFirstName: {
required: "* First Name required<br/>"
}
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="txtFirstName" name="txtFirstName" type="text" />
<input id="btnSubmit1" type="submit" runat="server" value="Submit" />
<button it="btnSubmit2" type="submit" runat="server">Submit</button>
</form>
</body>
</html>
source
share