But , there will be a day that we need to write a javascript function and used it as CustomValidation.
This is an example of CustomValidation that validate the value entered in a textbox.
The script will need 2 parameters , which will be supplied by CustomValidator control
function CustomValidation(ValidateResult,ObjectToValidate) {
if (ObjectToValidate.Value >= 1 && ObjectToValidate.Value <= 10) {
ObjectToValidate.IsValid = true;
}
else {
ValidateResult.innerText = "Please enter value in range of 1-10 only";
ObjectToValidate.IsValid = false;
}
}
Add a CustomValidator , point ControlToValidate to a textbox and set ClientValidationFunction as "CustomValidation"


9 comments:
Thanks for the shout out at my site. Nice tips as well!
Hi there
this is a very helpful script! nice tip ^_^
Firstly your site is great and have a lot of information.
Actually I have writing a blog about computer(http://computerblog-gab.blogspot.com). Now I attempt to increase my PR so i need to change link with you.
if you interested with my link exchange offer, plz contact me on :-
gabantiv@yahoo.com
I would appreciate if you deign to exchange link with me.
Thank you.
auto insurance missouri You have to almost put your self in their shoes and anticipate what that type of person is going to discard or read. It is difficult but you give it an honest attempt you might get more responses than deletes. Maria , texas car insurance
Thanks for the information....really appreciate it...
Thanks for the information....really appreciate it...
alamak cool sgt ni
good info
Post a Comment