gregzilla
03-19-2003, 04:47 AM
Hello,
I have two form fields in a form named "myform".
One is:
<input type="text" name="thing[1]" value="Blaa">
and the other is:
<input type="text" name="stuff">
How do I copy the value of the first field into the second field.
I've tried the following:
document.myform.stuff.value = document.myform.thing[1].value;
But it gives the error:
Error: 'document.myform.thing.1' is null or not an object
The reason I need that "[1]" in the name of the first field is because I actually have many fields, all of them named "thing" but with different numbers (ie: thing[2], thing[3], etc...) This is so they get passed into my PHP script as an array.
Thanks for any help you can give,
Greg
I have two form fields in a form named "myform".
One is:
<input type="text" name="thing[1]" value="Blaa">
and the other is:
<input type="text" name="stuff">
How do I copy the value of the first field into the second field.
I've tried the following:
document.myform.stuff.value = document.myform.thing[1].value;
But it gives the error:
Error: 'document.myform.thing.1' is null or not an object
The reason I need that "[1]" in the name of the first field is because I actually have many fields, all of them named "thing" but with different numbers (ie: thing[2], thing[3], etc...) This is so they get passed into my PHP script as an array.
Thanks for any help you can give,
Greg