CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    4

    Question Extending HTML Forms

    I am trying to create an HTML form in which user will enter different items (he wants to purchase) in text fields. One text field is used for one item. Now it is not known in advance how much items the user will purchase so we cannot decide the total text fields required in advance. Is is possible to increase the number of text fields (using JavaScript) one by one if the user requires more fields.
    Bye

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Extending HTML Forms

    Use a <div> and change the innerHTML content. The form will process that as well.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3

    Re: Extending HTML Forms

    You also might use a little javascript function that would add one more field each time the previous was filled, using
    Code:
    document.write
    method.
    David Domingues at [email protected]. Feel free to visit http://www.webrickco.com

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: Extending HTML Forms

    Using document.write() after the page is already loaded re-writes the whole page content.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured