c# - Changing the required field validator error message with javascript -


i have required field validator generic error message; using java script want change error according conditions

i using code

    var rfvinternalnotes = document.getelementbyid("rfvinternalnotes");     rfvinternalnotes.innertext = "";     rfvinternalnotes.innertext = "please enter reason assigning question different person"; 

no javascript error custom message not displayed, instead displayed error message set required field validator properties. have tried this

rfvinternalnotes.errormessage= "please enter reason assigning question different person"; 

but no joy ; ? thanks

i think can better use custom validator , use clientvalidationfunction functions may somehow like:

<asp:customvalidator id="customvalidator1"            clientvalidationfunction="myclientvalidationfunction" />  <script language="javascript">       function myclientvalidationfunction(sender, args){                 sender.errormessage = "validation failed";                 args.isvalid = true; // false based upon conditions...                return;                } </script> 

client validation function reference


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -