SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add items to input fields

    Hi,

    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:
    <form>
    <table>
    <tr>
    <td><input type="checkbox" name="first1"> Bill</td>
    <td><input type="checkbox" name="first2"> William</td>
    <td><input type="text" name="firstname"></td>
    </tr>
    <tr>
    <td><input type="checkbox" name="second1"> Smith</td>
    <td><input type="checkbox" name="second2"> Smyth</td>
    <td><input type="text" name="surname"></td>
    </tr>
    <!-- dozens more rows -->
    </table>
    </form>

    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.

    Cheers,
    Feltex
    Last edited by feltex; Feb 15, 2007 at 20:04.


Bookmarks

Posting Permissions

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