- Where Developers Learn, Share, & Build Careers
I am trying to write a javascript function in which I want to show error message in invalid areas of assumptions whose group name was given is.
Actually I have a different set of assumptions and want to show an error message in the alert if the value entered is valid for the group, whose button is pressed using the normal function.
I am using the following code:
function check (group) {if (Page_ClientValidate (group)) {true; } Other {var message = ""; (I = 0; i & lt; Page_Validators.length; i ++) {If (! Page_Validators [i] .isValid) {message = message + Page_Validators [i] .Errormessage + "\ n"; }} Alert (enter the field marked with "* or invalid data \ n" + message); return false; }
I want to run the following section of code for a particular group of validators:
var message = ""; (I = 0; i & lt; Page_Validators.length; i ++) {If (! Page_Validators [i] .isValid) {message = message + Page_Validators [i] .Errormessage + "\ n"; }} Alert (enter the field marked with "* or invalid data \ n" + message); return false; }
If I understood correctly, a simple switch
Statement (I_ 0; i ++) {Switch (Page_Vieter [i]. ValidationGroup) {Case "MyGroup1": // break your
for your Javascript code; Case "MyGroup2": // Your Javascript Code Break; Default: // Your Javascript Code Brake; }}
If you need to view the Javascript object property, set the breakpoint in JavaScript and debug it using Visual Studio