1
You know how sometimes a website asks you to type in your email twice, and if they
don't match you get a javascript alert?
Well I'm doing the
opposite.
There cannot be two of the same values in my form.I have done the javacript for it, and thats all in place,
JAVASCRIPT
print " function BothFieldsIdenticalCaseSensitive() {n";
print " var one = document.formulize.ELEMENTA.value.toLowerCase();n";
print " var another = document.formulize.ELEMENTB.value.toLowerCase();n";
print " if(one == another) {n";
print " alert("Oops You selected the same option twice! Can you please change it before submitting?");n";
print " return false;n";
print " } else {n";
print " return true;";
print " };n";
print " }n";
print "-->n";
print "</script>n";
I have also called the function in the right spot (im sure):
$saveButton->setExtra("onclick=javascript:return BothFieldsIdenticalCaseSensitive();");
Now, here is the problemIf I have
10 different
form fields, how can I make sure that
none match?
Also, I have caled them ELEMENTA and ELEMENTB as an example, but cannot find the real variable in the file.
I am using FormulizePlease help!