I am trying to write javascript function in which I want to show the error message of the of the invalid fields of the validatiors whose groupname is given.
Basically I am having some different group of validators and want to show there error message in alert if value entered is in valid for the group whose button is pressed using common function.
I am using following code:
function check(group) {
if (Page_ClientValidate(group)) {
return true;
}
else {
var message="";
for (i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isValid) {
message = message + Page_Validators[i].Errormessage+ "\n";
}
}
alert("Enter following fields marked with * or Invalid Data\n"+message);
return false;
}
I want to run following section of code for particular group of validators:
var message="";
for (i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isValid) {
message = message + Page_Validators[i].Errormessage+ "\n";
}
}
alert("Enter following fields marked with * or Invalid Data\n"+message);
return false;
}
If i understood correctly, a simple
switchstatement would do the trickIf you need to see the javascript object properties, set a breakpoint in the javascript and debug using Visual Studio