J
Jon Hoowes
Hi,
I have inherited some code that has some form elements (radio buttons)
that are called "1", "2" etc.
for example:
<input name="2" type="radio" value="45">
<input name="2" type="radio" value="46">
I want to be able to access them through javascript to disable them;
forms.myform.2[0].disabled=true;
etc.
however I get a javascript error when I try to do this (something about a
missing semicolon).
My javascript skills are fine and I have other elements being disabled OK,
so I assume that this is a problem with the way that the elements were
named.
Unfortunately I don't have the option of renaming the elements. Is there
another way to access these elements?
I have tried:
var temp=forms.myform.2;
temp[0].disabled=true;
But I get the same missing semicolon error on the "var temp=..." line
Any thoughts appreciated!
Cheers,
Ben
I have inherited some code that has some form elements (radio buttons)
that are called "1", "2" etc.
for example:
<input name="2" type="radio" value="45">
<input name="2" type="radio" value="46">
I want to be able to access them through javascript to disable them;
forms.myform.2[0].disabled=true;
etc.
however I get a javascript error when I try to do this (something about a
missing semicolon).
My javascript skills are fine and I have other elements being disabled OK,
so I assume that this is a problem with the way that the elements were
named.
Unfortunately I don't have the option of renaming the elements. Is there
another way to access these elements?
I have tried:
var temp=forms.myform.2;
temp[0].disabled=true;
But I get the same missing semicolon error on the "var temp=..." line
Any thoughts appreciated!
Cheers,
Ben