homepage Welcome to WebmasterWorld Guest from 23.20.220.79
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
dropdown javascript not working in netscape
am I up ****'* creek...or is there a way around it?
MichaelThomas




msg:1494911
 11:15 am on Oct 11, 2001 (gmt 0)

function dropdown1() {
document.Anuncio.PreSubCategoria2.value='';
document.Anuncio.PreSubCategoria3.value='';
document.Anuncio.PreSubCategoria4.value='';
}
function dropdown2() {
document.Anuncio.PreSubCategoria1.value='';
document.Anuncio.PreSubCategoria3.value='';
document.Anuncio.PreSubCategoria4.value='';
}
function dropdown3() {
document.Anuncio.PreSubCategoria1.value='';
document.Anuncio.PreSubCategoria2.value='';
document.Anuncio.PreSubCategoria4.value='';
}
function dropdown4() {
document.Anuncio.PreSubCategoria1.value='';
document.Anuncio.PreSubCategoria2.value='';
document.Anuncio.PreSubCategoria3.value='';
}

There´s 4 drop downs....and when the user clicks on one of them...the other three´s values return to their original position. It doesn´t work in netscape. Anybody have any ideas why?

i called the 4 different functions with "onFocus" in their respective drop downs.

if anybody has an answer, I´d appreciate it. I´m about to right hook my computer monitor.

 

EX_S




msg:1494912
 2:01 pm on Oct 11, 2001 (gmt 0)

Instead of:
document.Anuncio.PreSubCategoria2.value='';

try:
document.Anuncio.PreSubCategoria2.selectedIndex = 0;

See if that works.

MichaelThomas




msg:1494913
 10:49 am on Oct 15, 2001 (gmt 0)

thanks a lot for the help
...I tried that and they still don´t change in netscape.

Has anyone come across a problem similar to this one...or any other problems with validating dropdowns with javascript?

joshie76




msg:1494914
 5:36 pm on Oct 19, 2001 (gmt 0)

EX_S suggestion is the right way to achieve the effect you're after and it worked for me in IE, NN4, and NN6.

Here's the page I wrote to test it out:


<html>
<head>
<title>Untitled</title>

<script>
function drop1()
{
document.frmtest.test2.selectedIndex = 0;
document.frmtest.test3.selectedIndex = 0;
}

function drop2()
{
document.frmtest.test1.selectedIndex = 0;
document.frmtest.test3.selectedIndex = 0;
}

function drop3()
{
document.frmtest.test2.selectedIndex = 0;
document.frmtest.test1.selectedIndex = 0;
}
</script>
</head>

<body>
<form name="frmtest">
<select name="test1" onchange="drop1()">
<option>1
<option>2
<option>3
</select>
<select name="test2" onchange="drop2()">
<option>1
<option>2
<option>3
</select>
<select name="test3" onchange="drop3()">
<option>1
<option>2
<option>3
</select>
</form>
</body>
</html>

Important points to check are that your select boxes are correctly (try a html validator) nested within the appropriate form tags.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved