SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Edinburgh, UK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Add textfield to form

    Could someone who knows a bit more than me tell me how I add an extra textfield to a form with javascript?

    I have been googling for an hour now ... no luck

    Any one would be kind enough ?

    Thanks

    Geza

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Location
    Edinburgh, UK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent Thank you very much !!

    R.

    Geza

  4. #4
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Code Sample

    Code:
    //  Adds a new input [textbox] element to the end of the first form on a page.
    function addTextBox()
    {
         var textbox = document.createElement("input");
         textbox.setAttribute("type", "textbox");
         document.forms[0].appendChild(textbox);
    }
    Last edited by stymiee; Jul 13, 2006 at 16:28.


Bookmarks

Posting Permissions

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