473,796 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatically select specific checkboxes on clicking a radio button

1 New Member
Hi all...

My problem is I'm trying to make a form containing radio buttons and checkboxes. But on the event that one of the radio buttons is selected i want specific checkboxes to then be automatically selected.

E.g.
"On the event that gender male (radiobutton) is selected - for the form to then automatically select the following film genre (checkboxes) Action, Sci-Fi and Crime and leave unselected the remaining checkboxes."

Gender: >Male >Female


Film Genres:
Action[ / ] Romance[ ] Sci-Fi[ / ]
Musical[ ] Crime[ / ] Disney[ ]



If anyone can suggest how i would go about achiveing this; i would be truely grateful.
Mar 12 '08 #1
2 1968
Markus
6,050 Recognized Expert Expert
Hi all...

My problem is I'm trying to make a form containing radio buttons and checkboxes. But on the event that one of the radio buttons is selected i want specific checkboxes to then be automatically selected.

E.g.
"On the event that gender male (radiobutton) is selected - for the form to then automatically select the following film genre (checkboxes) Action, Sci-Fi and Crime and leave unselected the remaining checkboxes."

Gender: >Male >Female


Film Genres:
Action[ / ] Romance[ ] Sci-Fi[ / ]
Musical[ ] Crime[ / ] Disney[ ]



If anyone can suggest how i would go about achiveing this; i would be truely grateful.
Unfortunately you've posted in the 'feedback' forum.
You might want to try the javascript forum :P
Mar 12 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
My problem is I'm trying to make a form containing radio buttons and checkboxes. But on the event that one of the radio buttons is selected i want specific checkboxes to then be automatically selected.
Call a function onclick (radio buttons) which checks the checkboxes, e.g.
Expand|Select|Wrap|Line Numbers
  1. var checkboxes = document.getElementsByName(checkboxesName);
  2. for (i=0; i < checkboxes.length; i++) {
  3.   if (checkboxes[i].value == "Sci-Fi") checkboxes[i].checked = true;
  4.   ...
  5. }
Ps. changed thread title to better describe the question.
Mar 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
6559
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
9
2995
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
1
6165
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there are no instructions on how to make checkboxes and radio buttons required. I've tried adding these to my form, but I'm having no luck. Anyone know how to add radio buttons and checkboxes using the existing code mentioned on the url? Thank you!
4
7404
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird. Unfortunately, Internet Explorer doesn't quite work as expected -- it gives me an "invalid argument" error that I don't know how to fix. Here's the entire script, with form, annotated to explain what I'm doing and where the problem is occurring. I...
9
4382
by: Marc | last post by:
Okay, here's the problem - I have 3 radio buttons, and 11 check boxes (which are disabled by default). I have the javascript below which when the last radio button is clicked, enables the checkboxes. <script type="text/javascript"> //<!]> </script> I used the JavaScript on 2 pages, on almost identical forms, and for some reason it doesn't work on the 2nd one - they just stay disabled,
3
4441
by: newjazzharmony | last post by:
Hello group, I want to automatically select a specific checkbox when a user clicks (selects) a specific item in a radiobutton group. Both controls are in the same form. Let's say for argument's sake that the form looks like this (inessential items left out for the sake of clarity): <form name=form1>
7
10918
by: lambertb | last post by:
Hi, is this possible to achieve this, and how? http://img217.imageshack.us/img217/779/derrrvw2.png thanks!
2
12443
by: Eric Layman | last post by:
Hi, I have a radio button and a combo box. Upon changing a value for radio button, the combo box values will be dynamically updated. I have an idea on how to go abt doing it but Im stuck into converting into code.
3
2791
by: camdev | last post by:
I have a form with 2 radio buttons and multiple checkboxes (see example below). The one radio button indicates all and the other radio button indicates the user has chosen specific options (checkboxes) from a list. Can I use javascript to automatically select the 2nd radio button if the users clicks on any of the checkboxes? <form name=form1> <input type=radio name=Radio1 value=All> <input type=radio name=Radio1 value=Specific> <input...
0
9524
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
10217
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
10168
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
6785
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
5440
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...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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 we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
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.