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

Trigger checkbox when combo box is changed

I have a PDF form that has a combo box "no_wireless_mics" with the
values "1" "2" and " " where " " is the default. I need a JavaScript
that will cause the check box "wireless_mics" to be checked
(value=true) when the combo box value is "1" or "2"

I ama JavaScript newbie and I'm having quite a time figuring this out.
Thank you for your time and attention.
Jul 20 '05 #1
2 7455
"Jason McDonald" <jm*******@nyc.rr.com> wrote in message
news:5c**************************@posting.google.c om...
I have a PDF form that has a combo box "no_wireless_mics" with the
values "1" "2" and " " where " " is the default. I need a JavaScript
that will cause the check box "wireless_mics" to be checked
(value=true) when the combo box value is "1" or "2"

I ama JavaScript newbie and I'm having quite a time figuring this out.
Thank you for your time and attention.


For example:

<html>
<head>
<script type="text/javascript">
function miscOnChange(obj){
if ((obj.value == 1) || (obj.value == 2)){
document.getElementById("wirelesmisc").checked=tru e;
}
else{
document.getElementById("wirelesmisc").checked=fal se;
}
}
</script>
</head>

<body>
<input type="checkbox" id="wirelesmisc">Wireless
<select id="misc" onchange="miscOnChange(this)">
<option value=""></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</body>
</html>

HTH

Vjekoslav
Jul 20 '05 #2
i think this should work:

<!-- Begin of sample -->

<script language="javascript">
function sel_onchange()
{
document.all.wireless_mics.checked = true;
}
</script>

<select id="no_wireless_mics" name="no_wireless_mics"
onchange="sel_onchange()">
[your options go here]
</select>

<input type="checkbox" id="wireless_mics" name="wireless_mics">

<!-- End of sample -->

"Jason McDonald" <jm*******@nyc.rr.com> wrote in message
news:5c**************************@posting.google.c om...
I have a PDF form that has a combo box "no_wireless_mics" with the
values "1" "2" and " " where " " is the default. I need a JavaScript
that will cause the check box "wireless_mics" to be checked
(value=true) when the combo box value is "1" or "2"

I ama JavaScript newbie and I'm having quite a time figuring this out.
Thank you for your time and attention.

Jul 20 '05 #3

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

Similar topics

3
by: Mark | last post by:
I have a form that contains the following: 2 radio buttons (Name and Number) 1 check box (for Inactive Members) 1 combo box (list of Member names or numbers) I use the radio buttons to...
0
by: Steven | last post by:
Hi, I'm creating a custom checkbox list control which will take 2 arraylists as input. (One will contain Names and other will contain 0s and 1s. 0 - uncheck 1- check). I'm able to create the...
0
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
3
by: David | last post by:
Hi If I change the checked value of the checkbox by code, I can not trigger the CheckedChanged event of a checkbox control. Is there any way to implement it? Thank you very much!
1
by: Zyrthofar | last post by:
Hi I have three textboxes indicating the individual RGB values of a color. When the user leaves a textbox (Leave event), I check the validity of that number and saves the three values to a set of...
4
by: sara | last post by:
Hi - I've looked at many posts, and cannot find the answer on this specific problem. I have several fields on a table, which I've defined as "Text", 3 characters, Format Yes/No (I picked up the...
2
by: mrstrong | last post by:
Gday, I have a datagridview that I am creating the columns programatically which all seems to work fine. I have a couple of dropdown boxes, so I have set the editMode= EditOnEnter. Now my...
2
by: mrstrong | last post by:
Gday, Why would all my checkboxes inside a datagridview stop working (ie checked state not updating when user clicks) when the datagridview's editmode property is changed to "EditOnEnter"? It...
2
by: ton | last post by:
Hi, I have a checkbox in a webserver control. Al modified fields (textboxes, dropdownlists, and checkboxes) will be examnied during a save method. In which I use: aa=...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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
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
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
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...

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.