I want to code a function in javascript that every time I call it in the webform it fires up an specific validator in that same webform.
It works flawlesly Josh because I'm not currently using ValidationGroup to group my validators. But I'll keep testing it because in order to make it work I'm using an unique validator group for the validator I want to fire. In the future as the webform gets more complex this won't be possible.
Emilio León
2009-03-12 21:53:09
So you want to be able to fire one specific validator? Not rely on the group mechanism? This way you can define your groups dynamically at runtime?
JoshBerke
2009-03-12 23:28:48
You're right againg Josh, I didn't think of defining groups dinamically, thanks for this info. It's a different perspective from what I was thinking but is certainly right and clean?
Emilio León
2009-03-13 19:08:01
Sure...you can also fire up Fiddler and walk through the javascript emitted for the validators...I think you might even be able to call a valid() method on the control to determine if its valid...
JoshBerke
2009-03-13 20:04:29
A:
The "CustomValidator" control lets you use javascript to validate your form. If you do this you should also do the same validation on the server so that the user can't just disable javascript to bypass the validation errors.
David
2009-03-12 21:32:02
Good Observation David. I once did it, but in this case I'm turning validators on and off dynamically via JavaScript according to webform conditions, so in order to validate in the server also, I have to let know the server which validators where turned on and off too.
Emilio León
2009-03-12 21:44:30