473,789 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnClick-problem with Netscape

I noticed that the following line of code works in IE 6 but not in Netscape
7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">

Nothing happens when I click on the radio button. There is not even an error
message.

This is a simplified version of the actual code, which is used to pass among
other things the value of a selected radio button to a JavaScript-function.
Does anybody know how this code can be made to work in Netscape?
Gerard van Wilgen
--
www.majstro.com (On-line translation dictionary / Enreta tradukvortaro)
www.travlang.com/Ergane (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)

Jul 23 '05 #1
5 1465

"Gerard van Wilgen" <gv********@pla net.nl> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:c7******** **@reader11.wxs .nl...
I noticed that the following line of code works in IE 6 but not in Netscape 7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">

Nothing happens when I click on the radio button. There is not even an error message.

This is a simplified version of the actual code, which is used to pass among other things the value of a selected radio button to a JavaScript-function. Does anybody know how this code can be made to work in Netscape?
Gerard van Wilgen
--
www.majstro.com (On-line translation dictionary / Enreta tradukvortaro)
www.travlang.com/Ergane (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)

I have checked on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6)
Gecko/20040206 Firefox/0.8. It's not a Netscape but the same engine. It
works fine. Sorry, but I couldn't check it on Netscape, but I think no
difference with Mozilla
Jul 23 '05 #2
Gerard van Wilgen wrote:
I noticed that the following line of code works in IE 6 but not in Netscape
7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">
You may need <form> tags, and the reference "this.form.selC omb[0].value".
Mick

Nothing happens when I click on the radio button. There is not even an error
message.

This is a simplified version of the actual code, which is used to pass among
other things the value of a selected radio button to a JavaScript-function.
Does anybody know how this code can be made to work in Netscape?
Gerard van Wilgen

Jul 23 '05 #3
Gerard van Wilgen wrote:
I noticed that the following line of code works in IE 6 but not in Netscape
7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">

Nothing happens when I click on the radio button. There is not even an error
message.

This is a simplified version of the actual code, which is used to pass among
other things the value of a selected radio button to a JavaScript-function.
Does anybody know how this code can be made to work in Netscape?

Gerard van Wilgen


If you want to pass the radio button value to a function, how about

onlick="alert(t his.value);"

If you want to access the values of radio buttons in a form, you can do
it using the forms collection and form elements collection. You can
access the form by it's number or by it's name:

document.forms['formname']
document.forms[formumber]

To access a radio button, you can use its element number in the form, or
it's name and index number, which might be more convenient if you have
several mixed types of form elements:

Selcomb 0 <input type="radio" name="selComb" value="0"
onclick="alert( document.forms['frmData'].elements[0].checked)">
Selcomb 1 <input type="radio" name="selComb" value="1"
onclick="alert( document.forms[0].elements[0].checked)">
Selcomb 2 <input type="radio" name="selComb" value="2"
onclick="alert( document.forms['frmData'].selComb[0].checked)">
Selcomb 3 <input type="radio" name="selComb" value="3"
onclick="alert( document.forms[0].elements[selComb,[0]].checked)">

Mike

Jul 23 '05 #4

"mscir" <ms***@access4l ess.com.net.org .uk> wrote in message
news:10******** *****@corp.supe rnews.com...
Gerard van Wilgen wrote:
I noticed that the following line of code works in IE 6 but not in Netscape 7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">

Nothing happens when I click on the radio button. There is not even an error message.

This is a simplified version of the actual code, which is used to pass among other things the value of a selected radio button to a JavaScript-function. Does anybody know how this code can be made to work in Netscape?

Gerard van Wilgen
If you want to pass the radio button value to a function, how about

onlick="alert(t his.value);"


Thanks, that works.
If you want to access the values of radio buttons in a form, you can do
it using the forms collection and form elements collection. You can
access the form by it's number or by it's name:


Okay, that works too. I do not even have to use the collections; putting the
input tags in a form is apparently enough.

I shall use the the first solution, because I do not really need a form
(nothing to submit to the server here).
Gerard van Wilgen
--
www.majstro.com (On-line translation dictionary / Enreta tradukvortaro)
www.travlang.com/Ergane (Free translation dictionary for Windows / Senpaga
tradukvortaro por Windows)

Jul 23 '05 #5
<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb.value)" >

Gerard van Wilgen a écrit:
I noticed that the following line of code works in IE 6 but not in Netscape
7.1:

<INPUT TYPE="radio" NAME="selComb" VALUE="0"
ONCLICK="alert( selComb[0].value)">

Nothing happens when I click on the radio button. There is not even an error
message.

This is a simplified version of the actual code, which is used to pass among
other things the value of a selected radio button to a JavaScript-function.
Does anybody know how this code can be made to work in Netscape?
Gerard van Wilgen


Jul 23 '05 #6

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

Similar topics

3
17702
by: bob | last post by:
Hi, consider this script: <script> function doIt() { alert("ok") } document.onclick=doIt // or document.onclick=doIt() </script>
4
39455
by: Dipin | last post by:
Hi All; I have this javascript which is adding a new button to the column in the row which is created dynamically, the innerhtml shows that the onclick event is correctly added but it never gets invoked when I click it. newcol = doc.createElement("TD"); newbutton = doc.createElement("input"); newbutton.name = "newChange"+__uid;
2
9183
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
2
18581
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } Which is called statically by: <button onclick="doClick(event,this);">Click me</button>
17
4884
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick event ? I've tried something like this: oncl = document.getElementById('mySpan').onclick oncl = oncl + '\n;alert(\'added\')' document.getElementById('mySpan').onclick = oncl
4
2271
by: RobG | last post by:
I have a function whose parameter is a reference the element that called it: function someFunction(el) { ... } The function is assigned to the onclick event of some elements in the HTML source:
2
3291
by: Sedef | last post by:
Hi, i'm trying to create a custom Button user control which will be derived from System.Web.UI.WebControls.Button. the normal server side Button class creates some client side javascript code for its onclick event. it's something like: <input type="submit" name="Button1" value="Button" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="Button1" /> what i want to do is to be able to...
7
2795
by: extremerep | last post by:
My task is to change the value of a button and then make it functional with the onClick handler. Changing the value to "Play Again" works, but making the onClick work accordingly does not. The following is a snippet of the script. What is keeping it from working? function displaycards1(){ document.form1.reveal1.value="Play Again"; document.form1.reveal1.onClick="setcards();"; } </script>
10
4082
by: Carlos Araya | last post by:
I have the following link on a web page <p class="menuitem"><a href="#" onclick="loadFragment('http://rivendellweb.net/fortress/home', 'index')" title="The Fortress Home">The Fortress Home</a></p>
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.