I've done some validation on javascript buttons before, however I can't seem to get on the right track in zen-cart. I think it's because the names of the radio button groups are arrays.
For instance if my radio buttons looks like this:
<input name="id[1]" type="radio" value="1" />
<input name="id[1]" type="radio" value="2" />
<input name="id[1]" type="radio" value="3" />
and I'm calling a validation function with:
if (!validateRadiobutton(document.cart_quantity.id[1])) errs += 1;
Javascript doesn't seem to like the name being an array
If I change the html names to:
<input name="test" type="radio" value="1" />
<input name="test" type="radio" value="2" />
<input name="test" type="radio" value="3" />
and call the function with:
if (!validateRadiobutton(document.cart_quantity.test)) errs += 1;
it works just fine.
Any idea how to properly pass the "id[1]" as the name to javascript?
Thanks so much for any help!



