In this post, we want to discuss a nice function to check the required field validation on jQuery. Before we get started, if you want to know about the jQuery Loading or Processing screen, please go through the following article: Processing/Loading with C# and jQuery.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<script type="text/javascript" language="javascript"> function validate() { if (document.getElementById("<%=txtDCNo.ClientID%>").value == "") { alert("Please Enter Valid DC No."); document.getElementById("<%=txtDCNo.ClientID%>").focus(); return false; } if (document.getElementById("<%=ddlIdentity.ClientID%>").value == '-1') { alert('Please Selcet Identity.'); document.getElementById("<%=ddlIdentity.ClientID%>").focus(); return false; } } </script> |
Simple Required Field Validation on jQuery
The article was published on June 18, 2014 @ 4:51 PM
Leave a Comment