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>
Comments
Post a Comment