Closed Thread Icon

Topic awaiting preservation: Show 'city drop box' if country = Spain (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8373" title="Pages that link to Topic awaiting preservation: Show &amp;#039;city drop box&amp;#039; if country = Spain (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Show &#039;city drop box&#039; if country = Spain <span class="small">(Page 1 of 1)</span>\

 
Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 11-01-2002 09:36

How can I make a drop down box shows when in another drop down box is selected 'spain' without opening or sending to another page?



Wakkos
follow the white rabbit

Nevel
Bipolar (III) Inmate

From: Amsterdam
Insane since: Jun 2002

posted posted 11-01-2002 15:03

Well, in any case you should use an event handler like onchange to check whether the item 'Spain' has been selected, and if it turns out to be 'Spain', you could do several things. You could dynamically add a select box through createNode() and add it to your document, or you could switch the visibility of the second select box. I guess that depends on what you regard to as better coding.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 11-01-2002 15:04

Ah the double drop down menu. I always go here for my DDDM needs:
http://www.wsabstract.com/script/cutindex16.shtml

I think this is what you are looking for:
http://www.wsabstract.com/script/cut183.shtml

___________________
Emps

FAQs: Emperor

fizgig
Nervous Wreck (II) Inmate

From: West Bloomfield MI
Insane since: Aug 2001

posted posted 11-01-2002 15:05

put it in a div set to display:none

put an onChange event in your select menu to run a function

have a function that does this

if(document.form.select.options[document.form.select.selectedIndex].value=="spain"){
div.style.display='inline';
}else{
div.style.display='none';
}

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 11-02-2002 10:00

Cool links Emps!! but for this simple form, I'm using the fizgig method.

But I have a proble: DIV is not defined.
Even when I change the name!
see form

I change the index from Spain to Alemania (ñ problems that I'll solve later)

Wakkos
follow the white rabbit

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 11-02-2002 11:52

Modify your function to look like this:

function comunidades()
{
&nbsp;&nbsp;&nbsp;&nbsp;if (document.globe.pais.options[document.globe.pais.selectedIndex].value=="Alemania")
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById('comunidades').style.display='inline';
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById('comunidades').style.display='none';
&nbsp;&nbsp;&nbsp;&nbsp;}
}


fizgig
Nervous Wreck (II) Inmate

From: West Bloomfield MI
Insane since: Aug 2001

posted posted 11-04-2002 16:46

yeah, replace DIV with the name of the div, like you replaced form and select with those names

comunidades.style.display='inline';


i've had trouble with getElementByID working in some browsers



[This message has been edited by fizgig (edited 11-04-2002).]

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 11-04-2002 17:53

Yeah, Worked cool!
thanks to all of you!
I didn't post before, because My PC is stoopid-HD-problemed

Wakkos
follow the white rabbit

« BackwardsOnwards »

Show Forum Drop Down Menu