Hi All,
I have just started using the requiredif validation rule with a field
that is also being validated with a mask rule. The server side
validation is working fine but the client side JavaScript has errors for
my requiredif form fields.
My form field requires the feild button2URL only if button2Lbl has been
entered and if button2URL it must pass the mask rule.
When I use my mask without the requiredif rule all is well in client
JavaScript the generated method is as follows:
function mask () {
this.aa = new Array("button2URL", "Button 2 URL must contain a
valid URL. For more information click the help icon.", new Function
("varName", "this.mask=/^http:\\/\\/|^file:\\/\\/|^mailto:[^ ]*$/;
return this[varName];"));
}
When the requiredif rule is added and the JavaScript breaks and the
generated method is:
function mask () {
this.aa = new Array("button2URL", "Button 2 URL must contain a
valid URL. For more information click the help icon.", new Function
("varName", "this.field-test[0]='NOTNULL'; this.field[0]='button2Lbl';
this.mask=/^http:\\/\\/|^file:\\/\\/|^mailto:[^ ]*$/; return
this[varName];"));
}
Below is my validation def for this form:
mask
^http:\/\/|^file:\/\/|^mailto:[^ ]*$
field[0]
button2Lbl
field-test[0]
NOTNULL
I have accepted that for now I will create my own static JavaScript for
the form to handle the requirdif fields but I would still like to use
the other rules and their client side validation with my reqiredif
fields.
Many thanks,
Greg