SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot egiblock's Avatar
    Join Date
    Aug 2001
    Location
    Mentor, Ohio
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question if user clicks 'other' dropdown list, then create and display a textbox.

    i have a dropdown list where a user can select, 'Yes','No', and 'Other'. What i need to have happen, is that if a user selects other, i need a textfield to appear so the user can enter a custom variable. does anyone have code for this??

    thanks

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you pick the bones out of this? DEMO


    Andy
    From the English nation to a US location.

  3. #3
    SitePoint Zealot egiblock's Avatar
    Join Date
    Aug 2001
    Location
    Mentor, Ohio
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that should work.

    thank you.

  4. #4
    SitePoint Zealot egiblock's Avatar
    Join Date
    Aug 2001
    Location
    Mentor, Ohio
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well that would work with multiple forms i guess.. here's the code i have so far...


    Code:
    	<style type="text/css">
    	<!--
    	 /* Initially hides all forms with a class of "hidden" */
    	 input.hidden{
    		display: none;
    	 }
    	//-->
    	</style>
    	<script language="javascript">
    	<!--
    	function MM_jumpMenu(selObj,restore){ //v3.1
    	 var formID = selObj.options[selObj.selectedIndex].value;
    	 <!-- This section could be written shorthand using loops. //-->
    	 <!-- Also investigate DreamWeaver's function: MM_findObj. //-->
    		document.getElementById('Coating1').style.display="none";
    		document.getElementById('CoatingOther').style.display="block";
    	 <!-- I like this line. Very neat //-->
    	 <!-- if (restore) selObj.selectedIndex=0; -->
    	}
    	//-->
    	</script>
    Code:
    <select name="coating" size="1" class="requiredItem box requiredYN" id="select6" style="font-size=9" #invalid_attr_id="18" onchange="MM_jumpMenu(this,1)">
    			<option selected id="Coating1">Coating</option>
    			<option value="TIALN" id="Coating1">TIALN</option>
    			<option value="TIN" id="Coating1">TIN</option>
    			<option value="TICN" id="Coating1">TICN</option>
    			<option value="Other">Other</option>
    			<option value="None" id="Coating1">None</option>
    		 </select>


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
  •