473,657 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

radio button

HI, I have aproblem with XHTML radio button.

<form name=" form">
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
</form>

I want that when the radio is clicked, it is not checked. in other word
I want the click has no effect on the radio.
in IE it work, but in FireFox, the first click check the radio, while
the second, the tirdth, etc.. don't check the radio.
Why the first click is different than the others?

Feb 8 '06 #1
8 4679
stefano wrote:
HI, I have aproblem with XHTML radio button.

<form name=" form">
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
</form>

I want that when the radio is clicked, it is not checked. in other word
I want the click has no effect on the radio.
in IE it work, but in FireFox, the first click check the radio, while
the second, the tirdth, etc.. don't check the radio.
Why the first click is different than the others?


Hi

I think a radio object expects one option to be checked.
If you create some options, many browsers will even check the first if you
do not set another one explicitly (CHECKED).

So I think you are relying on strange/buggy behaviour in whatever it is you
are trying to achieve. :-)

Regards,
Erwin Moller
Feb 8 '06 #2

"stefano" <st**********@t iscali.it> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
HI, I have aproblem with XHTML radio button.

<form name=" form">
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
</form>

I want that when the radio is clicked, it is not checked. in other word
I want the click has no effect on the radio.
in IE it work, but in FireFox, the first click check the radio, while
the second, the tirdth, etc.. don't check the radio.
Why the first click is different than the others?


<script type="text/javascript">
function click4(myName)
{
document.getEle mentById(myName ).checked=true;
}
</script>

<form name=" form">
<input name="radio1" type="radio" onclick="click4 ()" />
<input name="radio2" type="radio" onclick="click4 ()" />
<input name="radio3"ty pe="radio" onclick="click4 ()" />
<input name="radio4" type="radio" onclick="click4 ()" />
</form>
Totus possum, totum Deum.
Totus ero, totum meum.
WSW
Feb 8 '06 #3
Sorry I just copied your form forgot the changes I made to it

function click4(myName)
{
document.getEle mentById(myName ).checked=true;
}
</script>

<form name="form">
<input name="radio" id="r1" type="radio" onclick="click4 ('r4')"/>
<input name="radio" id="r2" type="radio" onclick="click4 ('r4')"/>
<input name="radio" id="r3" type="radio" onclick="click4 ('r4')"/>
<input name="radio" id="r4" type="radio" onclick="click4 ('r4')"/>
</form>
Feb 8 '06 #4

"Lee" <RE************ **@cox.net> wrote in message
news:ds******** @drn.newsguy.co m...
News said:

Sorry I just copied your form forgot the changes I made to it


Please don't change the subjects of message threads.


OK won't again
Feb 8 '06 #5
stefano wrote:
HI, I have aproblem with XHTML radio button.

<form name=" form">
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
<input name="radio" type="radio" onclick="return false" />
</form>

I want that when the radio is clicked, it is not checked. in other word
I want the click has no effect on the radio.
Then disable it - no script required:

<input name="radio" type="radio" disabled="disab led" />

Though a better way is to use script to disable it since you will likely
want to use script later to enable it.

It's probably not a good idea to give the buttons a name that is the
same as the value of an HTML attribute, perhaps make the name
'radioGroup01' or similar.

For what it's worth, the following does what you ask (provided script is
enabled):

<input name="radio" type="radio" onclick="this.c hecked=false;" />
But it does not guarantee that a user can't check the button.

in IE it work, but in FireFox, the first click check the radio, while
the second, the tirdth, etc.. don't check the radio.
Why the first click is different than the others?


What it does for me is keep whichever button I click on first checked,
essentially disabling subsequent clicks. What should 'return false' do
when a radio button is clicked?
--
Rob
Feb 9 '06 #6
Lee wrote:
News said:

Sorry I just copied your form forgot the changes I made to it


Please don't change the subjects of message threads.

On the contrary, always update the subject when it is appropriate so to do.

Usenet messages are threaded by reference header, not by subject, so you
won't break the threads changing the subject except for people using broken
newsreader programs.

(admittedly that particular change of subject wasn't exactly useful, but it
does no harm.)
Feb 9 '06 #7
JRS: In article <ds********@drn .newsguy.com>, dated Wed, 8 Feb 2006
13:48:26 remote, seen in news:comp.lang. javascript, Lee
<RE************ **@cox.net> posted :
News said:

Sorry I just copied your form forgot the changes I made to it


Please don't change the subjects of message threads.


Disregard that. It's meaningless (a thread does not have a subject;
articles have subjects) and its intent is wrong.

The subject line can and should be changed if the topic of the article
changes enough to justify it.

There's no need to pander to inferior newsreaders that cannot thread
articles on References.

However, the subject line should not be changed arbitrarily or in the
manner in which "News" changed it.

"News" has provided a demonstration of one of the stupidities of Lahn-
style attributions; they become useless where the "author's name" is not
a name, or is unreasonably short or common.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Feb 9 '06 #8
Lee wrote:
Usenet messages are threaded by reference header, not by subject, so
you won't break the threads changing the subject except for people
using broken newsreader programs.


Of course it doesn't break the threading, but in some (many? most?)
readers, when viewing thread summaries, the thread is titled according
to its most recent subject.

Yes, and that is why as a thread drifts you change the subject to one which
is more relevant. It is also why you should usually preserve the original
subject within the new one as I've done above, at least for the first
message or two after the subject changes. If you were to respond to this
message you could reasonably drop the 'was ...' part of the subject and the
flow of the thread would still be clear to everyone.

You seem to be missing the point entirely though: the change of subject
which sparked this was inappropriate and pointing this out to the OP would
have been fine, but a blanket 'don't change subjects' is plain wrong.
Feb 10 '06 #9

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

Similar topics

4
3266
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1> <input type="radio" name=p2 value=2> <input type="radio" name=p2 value=3> then a text area and a button:
5
3094
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the user clicks on the "Choose" button of the input field (to select a file on the local disk), then radio button B is automatically
3
3119
by: John Davis | last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to uppercase. If the user clicks the other radio button, the text will change to lowercase. I added the following event, but still won't able to change the text to uppercase. Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
3
2065
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way (trick, custom RadioButton, or javascript) to make radio button (radio1) belong to 2 independent radio button groups instead of one? This would be an equivalent of sayting something like radio1.GroupName1 = "GroupA"; radio1.GroupName2 = "GroupB";
8
5897
by: David Cameron | last post by:
I noticed that using an HTMLInputRadioButton and specifying a value to be an empty string (""), this is overridden by ASP.Net which set the value of the control to be the same as the ID of the control. See the code below * Page.aspx: <%@ Page language="c#" Codebehind="Test.aspx.cs" AutoEventWireup="false" Inherits="Webspace.Test" %>
1
2972
by: Joe Attardi | last post by:
Hi all, On a form on one of my pages I have two <select> elements, and each one is paired up with a radio button. The idea is to choose an item from one list or the other and select the radio button of the list you want to use. I'm using JavaScript to automatically select the radio button corresponding to a list when you click on the list (using the onclick event handler). Is that the best event to change on, or should this
9
2232
by: IchBin | last post by:
I can not see what the problem is with this script. I am just trying to set a radio button by calling setCheckedValue('abbr_letter', 'V'). Sorry I am new to javascript. <html> <head> <script type="text/javascript"> function setCheckedValue(radioObj, newValue) { if(!radioObj)
10
6074
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
0
2293
by: jehugaleahsa | last post by:
Hello: I have radio buttons bound to boolean properties in a business object. private void bindRadioButton(RadioButton button, string propertyName) { Binding binding = button.DataBindings.Add("Checked", exclusionBindingSource, propertyName,
8
4608
by: photoboy | last post by:
I have racked by brain long enough on this, so now I need the help of someone who knows what they are doing. Here is what I am trying to achieve: First, I have two radio buttons (both unchecked) that need to be validated when the submit button is clicked. Instead of the standard alert window popping up (which I have now), I want the radio button background color to change from the table color (E2E2E2) to red (FF0000) for both buttons...
0
8392
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
8305
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
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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...
0
8605
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...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.