I am hoping to change the text of a label based on the outcome of a client side validation control. Is there any way to do this using the regular expression validation control?
views:
32answers:
2
A:
Yes, assuming client-side validation is enabled for the Valdiator. There is a client-side API you can hook into to. See this:
http://msdn.microsoft.com/en-us/library/aa479045.aspx
Scroll down and read the "Special Effects" section, which uses a RegularExpressionValidator in the example. Note that it changes the background color rather than changing text in a label, but the main thing is seeing where you can put your own code. Also note that you can't change the server representation of the label. All you can do is normal javascript DOM manipulation.
Joel Coehoorn
2009-10-30 17:22:09
This came really close but I haven't been able to change any of the labels in my page. Essentially nothing happen even though the script runs.
ProgrammingPope
2009-10-31 18:11:19