I think this is a simple syntax question but I can't seem to find the answer so far...
I want my javascript to collect the value from a form input with the name
nType[731]
It has this name because in PHP this creates an array automatically.
The problem is that the number (731) is dynamic. I know a solution would be to send the number in the function call but I have already sent the number in another form field so it seems wasteful to send it twice.
I have tried the following:
Expand|Select|Wrap|Line Numbers
- num=731;
- nTypeName="nType["+num+"]";
- var v=form.nTypeName.value;
Expand|Select|Wrap|Line Numbers
- num=731;
- var v=form.nType[num].value;
Expand|Select|Wrap|Line Numbers
- num=731;
- var v=form.["nType["+num+"]"].value;
Thanks in advance...
Henry