Results 1 to 4 of 4
Related
-
Real Web TRAFFIC - special offer for "AHFB2000" forum Forum: Internet Services
Replies: 1 -
is there a difference between <script language="javascript> and <script type="text/javascript"> Forum: Javascript Forum
Replies: 8 -
input type=hidden name="to" VALUE="user@yahoo.com" Forum: HTML Forum
Replies: 1 -
how can i only make "one" link turn to another color when hovered(mouse moves to it)? Forum: CSS Forum
Replies: 5
-
03-04-2004, 04:54 AM #1
Drop Down menu "other" *ree text option
Hoping someone can direct me as how to get *ree text input in a drop down selection menu.
Here is what I have so far:
<SELECT NAME="job">
<OPTION VALUE="Pharmacist">Pharmacist
<OPTION VALUE="Technician">Technician
<OPTION VALUE="Medical Service Representative">Medical Service Representative
<OPTION VALUE="Other">Other</SELECT>
What do I ned to add so that the person selecting "Other" can provide a *ree text input?
Thanks
-
03-04-2004, 09:19 AM #2
I have used this code before:
Code:<html> <head> <script> function addOption(theSel){ oc = theSel.options.length; if(theSel.selectedIndex==oc-1){ newOpt = window.prompt("Enter Your Job",""); if(newOpt+"">""){ theSel.options[oc] = new Option(theSel.options[oc-1].text); theSel.options[oc-1] = new Option(newOpt, newOpt, true, true); } } } </script> </head> <body> <form> <select name="job" onChange="addOption(this)"> <option>Please select <option>Technician <option>Medical Service Representative <option>Other </select> <input type=submit> </form> </body> </html>
-
03-06-2004, 12:09 AM #3
Thanks! That worked nicely.
Corey,
Thanks man. It works great. Wish my coding was not so rusty or so bad to begin with.
Originally Posted by coreybryant
-
03-06-2004, 08:31 AM #4
Glad it worked
Someone gave me that code a long time ago & I use it when I need something like that.