I'm using the attribute form elements from the standard product info pages, to build a separate, custom form on another page.
I'm using Javascript to change, show & hide elements of the custom form, depending on which other attributes are selected.
The reason for removing the brackets is that one section of my custom form relies on a set of radio buttons controlling the contents of a dropdown menu below. Please see the except of code below to illustrate my problem, which is highlighted in red:
Code:
if(document.cart_quantity.id[2][0].checked==true)
{
locFrom.innerHTML='<select name="selectFrom" style="width:120px"><option value="test">Test</option></select>';
//document.write(locFrom.innerHTML);
}
if(document.cart_quantity.id[2][1].checked==true)
{
locFrom.innerHTML='<select name="selectFrom" style="width:120px"><option value="test2">Test2</option></select>';
}
Javascript uses the numbers [0], [1], [2] etc after the input name to identify each radio button in the set - but the fact that id[2] also contains bracketed numbers breaks the form.
I guess if it's not going to be possible to remove those brackets, I need to hit a Javascript forum instead!