I have a field called [EMAIL="field@code1"]field@code1[/EMAIL] in a form in a XSL page.
i want to use java script to do validation.
2. is there any other way i can referance the field.
YOu may have to put it in a string, and then use the string as part of an address.
I'm not familiar with XLS. What does the @ represent?
If you do actually NEED one in a name or id, use it as an id on the element.
and use the document.getElementById() method with the ID as parameter, as apposed to using document.forms[X].name, or whatever other collecion-based method you may be using.
var myField = document.getElementById("field@code1");
Code like this though, will certainly not work:
var myField = document.myform.field@code1;
Again, try and get the '@' out of the field id/name. A little investigation into permitted values in W3C XHTML for attribute of type 'id' says the pattern should be:
[A-Za-z][A-Za-z0-9:_.-]* //That is, one upper/lowercase alphabetic character followed by any number of alphanumeric characters, and/or (:_.-) characters