Results 1 to 5 of 5
Thread: Add items to input fields
Feb 15, 2007, 17:59 #1
- Join Date
- Feb 2007
- 0 Post(s)
- 0 Thread(s)
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.
Last edited by feltex; Feb 15, 2007 at 20:04.