Hi,
Sometimes when using both asp.net controls and javascript/jquery there is a need of running both asp.net validation control and our javascript code simultaneously without postback. Below is the code for validating this. The Page_ClientValidate() function actually validates and returns true or false based on the form's validations.
<script type="text/javascript">
var Done = 1;
function validate() {
if (Page_ClientValidate()) {
if (Done == 1) {
return true;
}
else {
return false;
}
}
else {
return false;
}
}
<script>
<asp:Button id="btnSubmit" runat="server" Text="Submit" onclick='validate()'/>
</script>
Sometimes when using both asp.net controls and javascript/jquery there is a need of running both asp.net validation control and our javascript code simultaneously without postback. Below is the code for validating this. The Page_ClientValidate() function actually validates and returns true or false based on the form's validations.
<script type="text/javascript">
var Done = 1;
function validate() {
if (Page_ClientValidate()) {
if (Done == 1) {
return true;
}
else {
return false;
}
}
else {
return false;
}
}
<script>
<asp:Button id="btnSubmit" runat="server" Text="Submit" onclick='validate()'/>
</script>