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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How do I make a text field active on selection of a menu item?

    Can I use 'onclick' to activate a text field in the same form when user selects a particular item from a dropdown menu?

    Thanks in advance,

    Claire

  • #2
    New Coder
    Join Date
    Dec 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What exactly are you trying to do? Can you be more specific please? Maybe an example?

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi there

    I am trying to get the last option on my dropdown menu ('Other') to display the textfield 'chosencountry' by using 'onClick'

    <select name="country" id="country">
    <option value="" Option 1</option>
    <option value="" Option 2</option>
    <option value="" onClick="">Other</option>
    </select>
    <br>
    <input type= "text" name="chosencountry" style="visibility:hidden">

    Thanks in advance

    Claire

  • #4
    New Coder
    Join Date
    Dec 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer

    I think this is what you are looking for:

    Code:
    <SCRIPT>
    function checkIt(value){
    	if (value == "Other"){
    		document.getElementById("field").style.display = "";
    	}
    }
    </SCRIPT>
    <SELECT name="country" id="country" onchange="checkIt(this.value);">
      <OPTION value="">Option 1</OPTION>
      <OPTION value="">Option 2</OPTION>
      <OPTION value="Other">Other</OPTION>
    </SELECT>
    <BR>
    <INPUT id="field" type="text" name="chosencountry" style="display:none;">
    greetz

  • #5
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a million.
    That's exactly what I wanted!

    I appreciate your time,

    Claire


  •  

    Posting Permissions

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