473,323 Members | 1,550 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,323 software developers and data experts.

Multiple radio inputs


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 it?

<form name=formulario>
<INPUT type=checkbox name=casilla>
<INPUT type=button value="Salir"
onclick="Goingout()">
</form>

<script>
function Goingout(){
if (document.formulario.casilla.checked) window.close()
else alert("Select this option to continue")
}
</script

elhombrebala
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message33852.htm

Jul 20 '05 #1
3 2269
In article <Gu**********@mail.forum4designers.com>,
elhombrebala <Gu**********@mail.forum4designers.com> wrote:
With this script I can force the user to select the checkbox before
continuing, but now I have a menu with lots of radio unputs and I would
like the user to select at least 2 of them; how can I check it?


<input type="radio" name="BFMS" value="10">

....

if (document.forms[0].BFMS.checked == true)
A hint.

Robert
Jul 20 '05 #2
JRS: In article <rc*****************************@news05.west.earth link.
net>, seen in news:comp.lang.javascript, Robert <rc*******@my-deja.com>
posted at Sat, 7 Feb 2004 03:56:20 :-

if (document.forms[0].BFMS.checked == true)


AFAICS, the == true serves no useful purpose.

<URL:http://www.merlyn.demon.co.uk/js-other.ht#PF> #7

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #3
elhombrebala <Gu**********@mail.forum4designers.com> wrote in message news:<Gu**********@mail.forum4designers.com>...
With this script I can force the user to select the checkbox before
continuing, but now I have a menu with lots of radio unputs and I would
like the user to select at least 2 of them; how can I check it?


The typical or intended use of radio buttons is like on an old car
radio. You put of a group of radio buttons and you are only allowed
to select on radio button from the group. You make a group by naming
all the radio buttons the same. This creates an array of radio
buttons with the same name and you use array indexing to access.

The general idea of check boxes are for making none, one, or more than
one selection from the group.

In you case, your want to force the user to make at least two
selections. Checkboxes are for this.

Now, if you have two groupings of radio buttons and you want the user
to fill have selected a radio button from both this would make sense.
I use ( ) to indicate a radio button.

Example:
Pick a color:
( ) red
( ) green
( ) yellow

Pick a style of finish:
( ) wood
( ) metal
( ) plastic

....
If I understand what you are proposing, you could be could be
producing a confusing panel for the user. Try to go with the intend
of radio and check boxes.

I hope my minimalistic example was helpful.

Robert

PS. == true is easier for me to read. I guess that I could get
confused over datatypes, but other than that I do not see a problem.
I guess it could be confusing to a reader who doesn't use == true.
Jul 20 '05 #4

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

Similar topics

6
by: TheKeith | last post by:
I am doing a form for my site and would like to enable and disable a radio button set depending on whether one of the choices on an outer radio button set is checked. How can I refer to all the...
1
by: David | last post by:
Hi, I have an ASP page with a form and the following code: ..... type=Radio Checked name=selectserial value=" & RS("PSL_F_Serial")..... Tis will carry over the value of RS("PSL_F_Serial"),...
2
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as...
3
by: ewitkop90 | last post by:
Here is my code: <SCRIPT> function transportchange(transport) { if (framenewinstall.Helpdesk.checked) framenewinstall.Helpdesk.checked=false; if (framenewinstall.CircuitNumber.checked)...
2
by: Mark Haase | last post by:
Hey All-- I'm rusty on my JavaScript but I'm pulling it back out to do a PHP/MySQL database application. I'm doing all the validation in PHP, but I'm using JavaScript to show/hide questions...
1
by: Jerry | last post by:
We have a 10-question quiz for kids, each question being a yes or no answer using radio selections. I'd like to keep a current total of yes's and no's at the bottom of the quiz (if the user selects...
17
by: Sam Kong | last post by:
Hello, There are 1 or more select elements with the same name in a form. Let's say that the name of the select is 'select1' and the name of the form is 'form1'. If there's only one select I...
6
by: dba | last post by:
using the following code with a problem.... echo "<input type='hidden' name='member_id' value=\"{$row}\">{$row}"; echo "<input type='radio' name='member_name' value=\"{$row}\">{$row}<br />"; ...
5
by: mad.scientist.jr | last post by:
According to http://www.quirksmode.org/js/forms.html you need to look through a radio button's members to find the value: I tried writing a reusable function to return the value, see code at:...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.