chucklasker
06-30-06, 05:04 PM
I want to use a Javascript checkform validation script to validate a product page's attributes. I'm hard-coding the form completely, and it has [] characters that are screwing up the Javascript.
Here is some of the attribute code:
<INPUT TYPE="hidden" NAME="AttributeCode[3]" VALUE="PartInfo">
Middle Name:
<INPUT TYPE = "text" NAME = "AttributeValue[3]" VALUE = "" SIZE = 40>
Here is the onsubmit script:
<INPUT TYPE="submit" VALUE="Add To Basket" onClick="YY_checkform('form1','Attribute[3]','#q','0','Please enter your Middle Name.');return document.MM_returnValue">
The problem is, the brackets kill the javascript. Any idea how I can get around that?
Note - I'm using more sophisticated validation checks than the Miva server-side checks, which is why I'm using Javascript.
Here is some of the attribute code:
<INPUT TYPE="hidden" NAME="AttributeCode[3]" VALUE="PartInfo">
Middle Name:
<INPUT TYPE = "text" NAME = "AttributeValue[3]" VALUE = "" SIZE = 40>
Here is the onsubmit script:
<INPUT TYPE="submit" VALUE="Add To Basket" onClick="YY_checkform('form1','Attribute[3]','#q','0','Please enter your Middle Name.');return document.MM_returnValue">
The problem is, the brackets kill the javascript. Any idea how I can get around that?
Note - I'm using more sophisticated validation checks than the Miva server-side checks, which is why I'm using Javascript.