Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Dynamically Select show an element in a form

Dynamically Select show an element in a form

mull300
03-28-2006, 07:31 PM
Ok I have been trying to write a script that when i make a selection from a drop down menu it will display another dropdown menu based on the selection made. for isnstance.

for drop down 'A' if '1' is selcted show dropdown '1'

A1ien51
03-28-2006, 09:15 PM
basic idea:

var sel = document.forms[0].selectionName;
var strValue = sel.options[sel.selectedIndex].value;

document.forms[0].elements["OtherselectionList" + strValue].display = "inline";
run with that.

Eric

mull300
03-29-2006, 01:48 AM
ok so this is what my button code looks like and ugh?!?:confused: what am I doing wrong

<option value="MA" onFocus="javascript:showOptions("MA");">MA</option>

Kor
03-29-2006, 07:53 AM
should have used onchange event, not onfocus, aplied on select element, not on options subelements:

<select onchange="showOptions(this.value)">


 

TOP

Hyperthreading hurts s
HP sharpens blade PC l
Apple goes for Quad po
Itanium gets scaled do

For more info

HP sharpens blade PC l
Hyperthreading hurts s
can not call click() i
script does not work o
smart menu 
write to an html file 
FireFox doesn't recogn
Changing e.keyCode (e.
Clearing a range creat
UPDATE: My mouse over 

News Archive

onChange Help 
beforeload? vs onload.
Problem with document.
decreasing my javascri
Problem with \\ and \ 
how to stop scrolling?
Change Label Text Colo
Can I forward a page b
2 javascript functions
Validating a textbox 

Related stories:

conditional error checking
Command Buttons & Text Field Data Entry?
validating form field if radio button is checked
Question- Please HELP !
how do you create a pop-up window?
window.back() Fails in IE
Querying a page without reloading current page
document.write browser specific response
button value not being sent

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics