JSFiddle - React, Tailwind, and code Playground
by Shree Khanal
HTML
<script src="http://www.aspnetcommunity.org/js/jquery.validate.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</script>
<script type="text/javascript">
$(function() {
var v = $("#form1").validate({
ignore: ':hidden',
rules: {
txtTest: { required: true }
},
messages: {
txtTest: "Please enter a Post Title"
}
});
$("#btnTest").click(function() {
if (v.form()) {
alert('hi');
}
else {
alert('bye');
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" PageSize="1"
onpageindexchanging="GridView1_PageIndexChanging">
<PagerSettings Mode="NextPreviousFirstLast" FirstPageText="First" PreviousPageText="Previous" NextPageText="Next" LastPageText="Last" />
</asp:GridView>
<input class="required" type="text" id="txtTest" name="txtTest"/>
<input type="button" id="btnTest" value="Test" />
</div>
</form>
</body>
</html>