473,480 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Re: Taking action only when two sets of radio buttons have both been selected

In comp.lang.javascript message <d4**********@hotpop.com>, Fri, 18 Jul
2008 23:23:13, Lasse Reichstein Holst Nielsen <lr*@hotpop.composted:
>Steve Swift <St***********@gmail.comwrites:
>I have a page with two sets of radio buttons. I'd like to take an
action only when both sets of radio buttons have a selected button.

So you need to either remember or compute whether each group has
a button selected.
Not necessarily.

If each set of radio buttons has an additional default hidden button,
then it is only necessary to test that said button is not selected to
determine that one of the others has been selected.

Alternatively, that default button can be non-hidden but labelled
something like "I'm still thinking about this question"; then if the
user makes a selection and realises that it was too hasty he can un-make
it and be protected against sending the hasty answer.

I don't believe that the E-mail address in the sig of the quoted LRN
article actually works. Amusingly, the Google translation of "oversat
til dansk" appears to be "translated into English".

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 19 '08 #1
2 1146
Dr J R Stockton wrote:
If each set of radio buttons has an additional default hidden button,
then it is only necessary to test that said button is not selected to
determine that one of the others has been selected.
Thank you, that would make my test quite simple. The page itself is
built by a CGI script, so I don't need to know enough Javascript to loop
over all the sets of radio buttons in the page - the CGI script can
generate a longer JavaScript clause when there are more sets.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Jul 20 '08 #2
Steve Swift wrote:
Thank you, that would make my test quite simple.
Indeed, very simple. My test page at http://swiftys.org.uk/buttons.html
is now working. Thank you.

That page is static HTML, but the production page will be generated by a
CGI script which can extend the "if" statements according to the number
of buttons in each group.

I'm actually not expecting there ever to be more than one group, but it
might occur very occasionally.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Jul 20 '08 #3

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

Similar topics

7
3191
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
2
3681
by: Jon | last post by:
Hi, im trying to create an interface, which has a button and 2 radio buttons, which affect text which is outputted to a text area when the button is pressed. The button works on its own, but I can...
3
2278
by: elhombrebala | last post by:
With this script I can force the user to select the checkbox befor continuing, but now I have a menu with lots of radio unputs and I woul like the user to select at least 2 of them; how can I check...
19
2962
by: Pete | last post by:
I have form/select which executes a function using onchange. No problem. However, when I validate the page with a strict HTML 4.01 doctype at http://validator.w3.org, it demands either an action or...
6
3253
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked ...
3
3525
by: Alpha | last post by:
I have 3 radio buttons for include, exclued or 'select all' from the listbox items. If a user selects the 'Select All' button' then all items in listbox is hi-lited as selected. Now, when user...
11
4173
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
0
7046
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
7048
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
7088
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
5342
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,...
0
4485
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...
0
2997
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...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
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...

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.