#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0

    Question Display hidden element twice or more


    Hello

    I could display hidden element through the use of Java script.

    How can I display the same hidden element more than once.



    lets say that the email input filed is hidden and when user clicks display email field then it comes up. I wanted to come up again when user clicks the same bottom again.
  2. #2
  3. Known to taste like chicken
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    In front of my computer
    Posts
    399
    Rep Power
    312
    not a php question from what I can tell. You would need to use javascript for this.

    I think what you are saying is that you want a user to be able to click the button and it adds another field each time they click it? so click it once get 1 field, click it again get a second field etc etc?

    if so you would do something like

    Code:
    document.getElementById('containerDivId').innerHTML += "<input type=\"text\" name\"blah\" id=\"blah\">";
    take that code with a grain of salt it's only an example and I'm no javascript expert. Also that would only add the input at the end of the div, so it would be after the </form> tag etc, so more would be needed to achieve what you want, but that's the gist of what you would need.

    Maybe a mod could move this thread to the JS forum where you will get more love?
    Last edited by sir_drinxalot; December 30th, 2012 at 05:55 AM.
    "Take thy beak from out my heart, and take thy form from off my door" - Homer J Simpson / Edgar Allan Poe

    Looking for a project Idea?

IMN logo majestic logo threadwatch logo seochat tools logo