Re: A select drop-down that appears/disappears according to previous selection.
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: A select drop-down that appears/disappears according to previous selection.

From: Randy Webb <HikksNotAtHome@aol.com>
Date: Wed Aug 31 2005 - 07:43:33 CEST

ASM said the following on 8/30/2005 8:47 PM:
> pk wrote:
>
>> Here is my code, and it's not working. Please help me get through
>> this. I've read every single tutorial and you may even see remnants of
>> some of their variables in my code. I don't know if I'm close, but I
>> feel that I'm getting there.
>>
>> Thanks in advance for any help. I much appreciate it.
>>
>> -pk
>>
>> <SCRIPT>
>>
>> function able(dropdown)
>> {
>> var myindex = dropdown.selectedIndex
>> if(myindex = 1) {

if (myIndex==1)

== is comparison
= is setting the variable.

Since it can set the var myindex to 1, it will always evaluate as true
so you never get to the else branch.

-- 
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Received on Tue Oct 18 03:14:58 2005