Add items to input fields
I have a problem with a form where I'd like to populate input fields when checkboxes are selected.
It's almost answered for me in http://www.sitepoint.com/forums/showthread.php?t=457892 but I can't work out how to get it to scale for several "input type=text" fields. (The example here works beautifully with a single textarea)
The HTML code is more or less like this:
<td><input type="checkbox" name="first1"> Bill</td>
<td><input type="checkbox" name="first2"> William</td>
<td><input type="text" name="firstname"></td>
<td><input type="checkbox" name="second1"> Smith</td>
<td><input type="checkbox" name="second2"> Smyth</td>
<td><input type="text" name="surname"></td>
<!-- dozens more rows -->
What I would like to do is have the ability to select Bill and/or William and for that to populate the first text input and so on.
Any help would be greatly appreciated.
An example that might help?
Here is an example similar to what your asking I think. I didn't comment it very well but I did it in High School while teaching myself... if you just ignore the ads it might help. Its just a little game thing but it is browser compatible with all the ones ive tested it with. Just look at the source. Use anything u need. http://web_master_00.tripod.com/Torrentrpg/battle.html