activate check boxes dependent on radio button selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a simple form that has two radio buttons. The second
button would activate a set of check boxes to select. For example:

Radio Buttons - Inform me of new releases for all publications
- Inform me only when the selected publications are
updated:

Check Boxes [] Document 1
[] Document 2

I've just not been able to figure out how to tie the Check boxes being
active to the second radio button.

Can this even be done in Front page?

Thanks in advance.

Cindy
 
If your two check boxes are named chkDoc1 and chkDoc2, add this script
anywhere in the page (most likely in the <head> section):

<script>
function disableChks(){
document.forms[0].chkDoc1.disabled=true;
document.forms[0].chkDoc2.disabled=true;
}
function enableChks(){
document.forms[0].chkDoc1.disabled=false;
document.forms[0].chkDoc2.disabled=false;
}
</script>

and then code your radio buttons like this:

<input type="radio" name="pubs" value="a" onclick="disableChks();">
<input type="radio" name="pubs" value="s" onclick="enableChks();">

Warning: this is probably IE-specific. Be sure to test it on any other
browsers you care about.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
Thank you very much. I will try this today.

Again - Thanks!

Cindy

Jim Buyens said:
If your two check boxes are named chkDoc1 and chkDoc2, add this script
anywhere in the page (most likely in the <head> section):

<script>
function disableChks(){
document.forms[0].chkDoc1.disabled=true;
document.forms[0].chkDoc2.disabled=true;
}
function enableChks(){
document.forms[0].chkDoc1.disabled=false;
document.forms[0].chkDoc2.disabled=false;
}
</script>

and then code your radio buttons like this:

<input type="radio" name="pubs" value="a" onclick="disableChks();">
<input type="radio" name="pubs" value="s" onclick="enableChks();">

Warning: this is probably IE-specific. Be sure to test it on any other
browsers you care about.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Windows SharePoint Services Inside Out
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------

Cindy said:
I am trying to create a simple form that has two radio buttons. The second
button would activate a set of check boxes to select. For example:

Radio Buttons - Inform me of new releases for all publications
- Inform me only when the selected publications are
updated:

Check Boxes [] Document 1
[] Document 2

I've just not been able to figure out how to tie the Check boxes being
active to the second radio button.

Can this even be done in Front page?

Thanks in advance.

Cindy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top