add controls dynamically in html page

Discussion in 'Javascript' started by ojvm, Jun 17, 2005.

  1. ojvm

    ojvm Guest

    thanks in advance for reading this.

    i am a really ignorant about js, so i need a guru to help me.

    i need to add n number of text box in a html page, the main idea is
    when the user press a button apear 2 text box and if he do it again
    apear 2 text box more and so on, also need that all the text boxes has
    a unique id, in order to make some thing whit the values. but i dont
    know how to do it. please hel me i'm trapped in this.
    ojvm, Jun 17, 2005
    #1
    1. Advertising

  2. ojvm

    Jc Guest

    ojvm wrote:
    > thanks in advance for reading this.
    >
    > i am a really ignorant about js, so i need a guru to help me.
    >
    > i need to add n number of text box in a html page, the main idea is
    > when the user press a button apear 2 text box and if he do it again
    > apear 2 text box more and so on, also need that all the text boxes has
    > a unique id, in order to make some thing whit the values. but i dont
    > know how to do it. please hel me i'm trapped in this.


    You will need to learn how to manipulate the browser DOM through
    javascript in order to do this. This is referred to as DHTML,
    http://www.w3schools.com/ is listed as a reference for DHTML on this
    groups FAQ, which is located at http://www.jibbering.com/faq/.

    You will likely choose to use one of two techniques:

    1. The document.createElement() method combined with
    appendChild()/insertBefore().

    2. The innerHTML property.

    References on these methods/properties can be found here:
    http://msdn.microsoft.com/library/d...hor/dhtml/reference/dhtml_reference_entry.asp

    You will also need to use javascript control statements such as a loop
    in order to easily add multiple textboxes:
    http://msdn.microsoft.com/library/d...56/html/js56jslrfJScriptLanguageReference.asp
    Jc, Jun 17, 2005
    #2
    1. Advertising

  3. ojvm

    ojvm Guest

    thank for help, but i really don't know who to start.
    ojvm, Jun 20, 2005
    #3
  4. ojvm wrote:

    > thank for help, but i really don't know who to start.


    Try yourself.


    SCNR

    PointedEars
    Thomas 'PointedEars' Lahn, Jul 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy S

    Dynamically add controls to a page

    Jeremy S, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    505
    Martin Dechev
    Mar 4, 2004
  2. Chad Scharf
    Replies:
    3
    Views:
    851
    Chad Scharf
    Oct 18, 2007
  3. ojvm
    Replies:
    0
    Views:
    86
  4. ojvm
    Replies:
    0
    Views:
    87
  5. ojvm

    add controls dynamically in html

    ojvm, Jun 22, 2005, in forum: Javascript
    Replies:
    1
    Views:
    83
Loading...

Share This Page