By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,570 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,570 IT Pros & Developers. It's quick & easy.

Trigger checkbox when combo box is changed

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.