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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts

    <option>other</option> pops <input type="text">

    Do you know those forms that let you choose from <select> options and also gives you the option to put your on text (usually once you select the "other" option)?
    Can someone refer me to one of these forms so I can sniff?
    Thanks!

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    It's usually as simple as having a hidden (style="display:none;" if you're IE-only ) div with your textinput in, and calling a function onChange of the selectbox that sets the display to visible depending on the value. Or you can change the innerHTML. I guess you could put the div over the selectbox if you wanna get all snazzy.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I didn't understand this last sentence: "Or you can change the innerHTML. I guess you could put the div over the selectbox if you wanna get all snazzy. "...
    And, is there way to make it compatible for both IE and Netscape?
    Thanks.

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    436
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Anyways,
    1. How can I change the style="display:none;" to the opposite using JS?
    2. What is the opposite in this case (for display:none)?
    Thanks


  •  

    Posting Permissions

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