Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamically adding html/form to page

    I have a html form which consists of various resume details.

    Part of this form is a 'employment history' sub-form (start date, end date, position etc) (1 per job)

    The problem is that the user may need to enter 1-5 employment history records but I want to display only 1 form by default and let them add more if they want.

    .. so I need a button which users can click, when they click this a piece of html code (employment history form) is added/displayed under the last.


    is this possible? or do th forms already need to exsist in the html?

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,518
    Thanks
    3
    Thanked 506 Times in 493 Posts

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You may do that in 2 different ways.

    1. If you need to create/change dynamic some elements, you may use DOM methods (like in vwphillips example)

    2. If you need only to restrain the length of the page (in order to let the user fill the form step by step) you may simply use the display attribute (none/block) to hide/reveal the already built in elements. The second methods has the advantage that the formular can be use as well by the users who might have their javascript disabled.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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