Results 1 to 2 of 2

Thread: How to add text boxes dynamically

  1. #1
    Join Date
    Jun 2005

    Exclamation How to add text boxes dynamically

    I have a form in which a user can enter anywhere from 0 to 10 zip codes to search on. I currently have a table in which one cell contains 10 text boxes they can enter data in. However, as you can imagine, this looks very awkward. I'd like to make it so that either after entering data, they can click a button to add another text box or move this text to a field above the text box and allow them to enter the next value.
    I have been looking all over the web and can't find anything that fits this model. Can someone please help me?!

    Thank you

  2. #2
    Join Date
    Sep 2006

    The best way is to add children to the parent object. What I mean is insert an id="name" to the parent that contains the zip text boxes. Add a button that says add additional zips or what ever once it is clicked add a child to that parent element. You can do the opposite as well with a delete child in case they make a mistake and decide to not have the number the want. I use this technique but with one suggestion, use good naming conventions so it is easy to add additional children and delte the children with out troubles.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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