473,398 Members | 2,404 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,398 software developers and data experts.

RadioButton (or Checkbox) event firing if selected (not changed)

Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.
Nov 19 '05 #1
5 3345
Hi Tom,

The reason the checkbox event fires is because it changed. When you click a
radio button that is already set it doesn't change so the onCheckedChanged
even will never fire. You'll need to rethink your design. When a user
clicks a radio button do what you need to do. If you have a radio button
checked as default, then when you dish out the page you will need to setup
your code so that everything you would do when that radio button is selected
is already done. Or, just push out the radio buttons with none of them
selected. Having a user click a radio button to select it, when it is
already selected, to perform some action is not very intuitive and probably
would just confuse the user. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.

Nov 19 '05 #2
What you could do is create the event in JavaScript, with the control being
in the server side. You could do that by closing the object in a span an
firing a function in the onclick of the span or the object that you have
your checkbox in.

Good Luck
"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.

Nov 19 '05 #3
"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi Tom,

The reason the checkbox event fires is because it changed. When you click
a
radio button that is already set it doesn't change so the onCheckedChanged
even will never fire. You'll need to rethink your design. When a user
clicks a radio button do what you need to do. If you have a radio button
checked as default, then when you dish out the page you will need to setup
your code so that everything you would do when that radio button is
selected
is already done. Or, just push out the radio buttons with none of them
selected. Having a user click a radio button to select it, when it is
already selected, to perform some action is not very intuitive and
probably
would just confuse the user. Good luck! Ken.
I agree.

I was trying to build a setup where the user indicates which row to move but
selecting a radio button. I was also using the button to deselect the row
(which you can't do if it is already selected - as you know). I went to the
checkbox, because it does allow you to select/deselect it. But then you get
the same problem - that it is counter-intuitive to the user who is used to
selecting multiple checkboxes (which would not be the case here).

What I will probably do is go back to the radio button, with a like that
says "deselect"?

Thanks,

Tom
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.


Nov 19 '05 #4
"Joaquin Corchero" <j_********@jocail.com> wrote in message
news:OW**************@TK2MSFTNGP10.phx.gbl...
What you could do is create the event in JavaScript, with the control
being in the server side. You could do that by closing the object in a
span an firing a function in the onclick of the span or the object that
you have your checkbox in.
Not really quite sure how to do that.

My problem would be how to get the javascript to access the objects in the
row.

When I selected a button it changes the color of the row as well as some of
the labels to indicate the row has been selected. When I select it the
second time, it puts it all back to it's original state.

Not quite sure how I could easily do this from Javascript.

Thanks,

Tom
Good Luck
"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.


Nov 19 '05 #5
Hi,

Can you tell me if when you look at the code generated in the client browser
you have an ID for each object?

<td id="td1"???

"tshad" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
"Joaquin Corchero" <j_********@jocail.com> wrote in message
news:OW**************@TK2MSFTNGP10.phx.gbl...
What you could do is create the event in JavaScript, with the control
being in the server side. You could do that by closing the object in a
span an firing a function in the onclick of the span or the object that
you have your checkbox in.


Not really quite sure how to do that.

My problem would be how to get the javascript to access the objects in the
row.

When I selected a button it changes the color of the row as well as some
of the labels to indicate the row has been selected. When I select it the
second time, it puts it all back to it's original state.

Not quite sure how I could easily do this from Javascript.

Thanks,

Tom

Good Luck
"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is there a way to allow a user to press a radio button if it is already
selected?

There is an onCheckedChanged event that fires when the person presses
the
button and it is isn't selected already. If it is selected, it doesn't
fire. This isn't the case with a checkbox. The event fires whether the
control is already checked or not.

Thanks,

Tom.



Nov 19 '05 #6

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

Similar topics

7
by: Shane Bishop | last post by:
I've been fighting with the Page_Load event firing twice. I looked through this user group and saw several other people having similar problems. There were various reasons for it:...
3
by: Jack Turnbull | last post by:
Hi, I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed OnCheckedChanged to a Sub but it doesn't fire. If I move the checkbox out of the Repeater it fires! Any ideas? Thanks
2
by: Chris Lane | last post by:
Hi, I have a web control button that I use for submitting a form, for some reason this causes a dropdownlist web control I have in a panel at the top of the form to execute it's selected index...
5
by: Steve Jones | last post by:
Hi there, I am working with web forms, and am finding that the standard list of combo box events is dramatically reduced when using the dropdownlist. For example, the only event that I can see...
3
by: LCAdeveloper | last post by:
Help! A trawl through the archives couldn't shed any light on this, so is there a way to handle DoubleClick events for RadioButtons in vb.NET? I'm recoding a VB4 application, which used the...
16
by: tommaso.gastaldi | last post by:
Hello, A probably dumb question... does anyone know hot to avoid that if one keep the mouse pressed on an arrow of the numericUpDown it continues to fire events (it uses evidently a timer) ?...
2
by: maxx429 | last post by:
Hi all, I am a VBA newb. I know probably just enough to be dangerous. :) Anyway, I have a Form that I am using <a href="http://allenbrowne.com/AppAuditCode.html">Allen Brown's Audit Trail</a> ...
37
by: viki1967 | last post by:
Hi all. I have this simple form. I need if checkbox C_1 is selected: 1) field name="n_1" is required and accept only numbers; 2) field name="n_2" is required and accept only numbers; I...
0
by: perumalsamy R | last post by:
I am using gridview in my project.When i am clicking the checkbox ,I want to add the price value on gridview selected index changed event.can you help for my problem please help me?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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.