SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Member
    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 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 21:04.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts