Dynamic Continuous Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blyxx86
    Contributor
    • Nov 2006
    • 258

    Dynamic Continuous Forms

    Hello Everyone!

    I'm starting to realize the project I'm working on is going to have a high demand for AJAX type integration. Most notably with the forms that need to be filled out by the user.

    A great number of forms are used to enter "one-to-many" types of related data into the database. (ie., one shipment will have many items)

    I would like the user to be able to enter all the information on one form instead of being required to enter the "one" part of information and then each subsequent item on a new form.

    What do you think is the best way to get to this? I'm thinking each form item will have "array" names (I use PHP). So instead of <input type="text" name"item" /> it will be <input type="text" name"item[]" /> which fails XHTML validation, but it's a necessary evil.

    Does anyone know of any prebuilt script out there that will create more form items as each "line" of the form is filled in. Preferably that will autocreate a new "name" for the form item with the array position (ie., "item[1]", "item[2]", etc..)

    Which script library would best suit my needs? I also have the need to perform autocomplete input boxes, and I am currently using a version of JQuery for that.

    Thanks for all the suggestions!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You need to create an input element dynamically. You can either use DOM methods or innerHTML. Here's one possible way of doing it which you could adapt.

    Comment

    • blyxx86
      Contributor
      • Nov 2006
      • 258

      #3
      Great. I will take a stab at what I need to do with this.

      Thank you.

      Comment

      Working...