473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Netscape does not fire onChange!

I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:

onChange="division_changed(this.value);"

If I put an alert() in the external script (outside any function) it
executes fine. If I put an alert directly in onChange it also works
fine! But this function that I'm calling simply won't get started.

What do I do to get it to work in these alternative browsers?

Jul 23 '05 #1
5 5114
Lee
Frowning Freezer said:

I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:

onChange="division_changed(this.value);"

If I put an alert() in the external script (outside any function) it
executes fine. If I put an alert directly in onChange it also works
fine! But this function that I'm calling simply won't get started.

What do I do to get it to work in these alternative browsers?


It would help to see your code.

Obviously the onChange handler is actually firing, since defining it
as "alert()" works.

The last time I looked (which has been some time), Select controls didn't have a
"value" attribute in Netscape. It was just a shortcut added by Microsoft.

onchange="division_changed(options[selectedIndex].value)"
might work.

Jul 23 '05 #2
In article <90********************************@4ax.com>, pu**@hverdag.dk
says...
I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:

onChange="division_changed(this.value);"

If I put an alert() in the external script (outside any function) it
executes fine. If I put an alert directly in onChange it also works
fine! But this function that I'm calling simply won't get started.

What do I do to get it to work in these alternative browsers?


I just tried this in IE6, Firefox, Opera 7.something, Mozilla. The only
difference between any of them is that IE alerts nothing, but it still
does the alert. What is the Mozilla JavaScript console telling you?

<script>
function division_changed(value)
{
alert(value);
}
</script>

<form>
<select onChange="division_changed(this.value);">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</form>

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 23 '05 #3
Frowning Freezer wrote:
I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:

onChange="division_changed(this.value);"

If I put an alert() in the external script (outside any function) it
executes fine. If I put an alert directly in onChange it also works
fine! But this function that I'm calling simply won't get started.

What do I do to get it to work in these alternative browsers?


First, I would make sure my references were correct.

onchange="division_changed(this[this.selectedIndex].value);"

or more formally:

onchange="division_changed(this.options[this.selectedIndex].value);

Mick
Jul 23 '05 #4
>> I have a function in an external javascript file which I fire from an
onChange event in a <SELECT> tag. Everything works fine in IE but not
in Netscape/Mozilla/Opera. This is my onChange statement:

onChange="division_changed(this.value);"

If I put an alert() in the external script (outside any function) it
executes fine. If I put an alert directly in onChange it also works
fine! But this function that I'm calling simply won't get started.

What do I do to get it to work in these alternative browsers?


First, I would make sure my references were correct.

onchange="division_changed(this[this.selectedIndex].value);"

or more formally:

onchange="division_changed(this.options[this.selectedIndex].value);


Thanks, this made my day - together with Macromedia's MM_findObj
function.

Jul 23 '05 #5
Luce
1
Hi !
I have exactly the same problem. In IE all works fine, but not in Mozilla.
This is my select form (HTML + PHP):

<select name="country" onchange="change_form(this.options
[this.selectedIndex].value,<? print $x;?>,<? print $y;?>,<? print $z;?>")>

My javascript has in alert set, it works in IE but not in Mozilla.

Please help, what I have to do ?
Apr 14 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kevin Ly | last post by:
Consider the test case below. The onmouseout event does NOT fire when my mouse/cusor is moved off the left side of the browser. It does if it is moved off the top, bottom, and the right side that...
2
by: Robbie | last post by:
Hi, I want to programatically fire an event. I have it working in IE, but Netscape won't work. What is the Netscape equivalent to, or a workaround for: document.myForm.myField.onchange(); ...
17
by: Adam | last post by:
Hi! I've modified a javascript order form calculation script that tallies up the subtotal, shipping/handling, and total automatically. I did some modifications and it still worked fine, even...
2
by: lmeng | last post by:
Hi, I am new to this Forum. Thanks in advance for any kind help. In the following HTML code, when I change the value of one text field then click "Modify" button, if the validation fails a...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
2
by: Dot net work | last post by:
Hello. If I use an asp.net custom validator control to validate a textbox, what I find is that if I enter in some text that I have already entered and validated in a previous session (you know...
7
by: Daniel | last post by:
Is there any other way can override this event, like javascript onchange added to the attribute of this dropdownlist? Thanks
1
by: Duncan | last post by:
Hi all, I'm tearing my hair out on this! I have a simple ASP.NET 2 page with a TextBox control, in the PreRender I set ClientSide events:- Response.Attributes.Add("onchange",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.