I modified the script from the link that John posted and this works.
Hopefully, you can modify it further to suit your needs.
HTH
Joe Kelly
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
// by Nannette Thacker
// http://www.shiningstar.net
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group...
// Pass the Checkbox group name...
// call buttons as so:
// <input type=button name="CheckAll" value="Check All"
//onClick="checkAll(document.myform.list)">
// <input type=button name="UnCheckAll" value="Uncheck All"
//onClick="uncheckAll(document.myform.list)">
// -->
<!-- Begin
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}
function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = false ;
}
// End -->
</script>
</head>
<body>
<form name="myform" action="checkboxes.asp" method="post">
<form name="myform" action="checkboxes.asp" method="post">
<b>Your Favorite Scripts & Languages</b><br>
<input type="checkbox" name="list" value="1">Java<br>
<input type="checkbox" name="list" value="2">Javascript<br>
<input type="checkbox" name="list" value="3">Active Server Pages<br>
<input type="checkbox" name="list" value="4">HTML<br>
<input type="checkbox" name="list" value="5">SQL<br>
<input type="button" name="CheckAll" value="Check All"
onClick="checkAll(document.myform.list)">
<input type="button" name="UnCheckAll" value="Uncheck All"
onClick="uncheckAll(document.myform.list)">
<br>
<b>Your Favorite Scripts & Languages</b><br>
<input type="checkbox" name="list2" value="6">Java2<br>
<input type="checkbox" name="list2" value="7">Javascript2<br>
<input type="checkbox" name="list2" value="8">Active Server Pages2<br>
<input type="checkbox" name="list2" value="9">HTML2<br>
<input type="button" name="CheckAll" value="Check All"
onClick="checkAll(document.myform.list2)">
<input type="button" name="UnCheckAll" value="Uncheck All"
onClick="uncheckAll(document.myform.list2)">
<br>
</form>
</body>
</html>
On 8/31/05, John Ivanoff <[EMAIL PROTECTED]> wrote:
> the dates that are in the 317-xxx-xxxx box, can change meaning I might
> have six today and maybe eight next month?
>
> I have a form, but the inputs are fixed, and I use JS to validate
> here's a snip
> ----------------------------------------------------
> function checkMed() {
> var i = 1
> for (var j = 3; j <= 7; j++){
> if (document.form1.elements[j].checked == true) {
> i=i+1;
> //document.form1.a_medical_selection.value=1;
>
> document.form1.a_medical_selection.value=document.form1.elements[j].value;
> if(document.form1.a_medical_selection.value == 4){
> document.form1.elements[13].checked = true;
> document.form1.a_dental_selection.value='4';
> }
> }
> if (i <= 1){
> document.form1.a_medical_selection.value='';
> }
> }
> }
> ----------------------------------------
> the " for (var j = 3; j <= 7; j++){ " is for the fourth through eighth
> check box on the form. but if the number of check boxes varies this
> fails.
>
> I'm not sure of the naming convention for your check boxes but could
> you do an substring() and look for check boxes the start with 317
>
> hth
>
> On 8/31/05, Ryan Everhart <[EMAIL PROTECTED]> wrote:
> > John,
> > Thanks for the post, I know how to check ALL on a form, now I have to
> > some how divide the form up into sections.
> >
> > Eric,
> > Thanks for you post as well, I'm trying to run with that.
> >
> > Ryan
> >
> >
> > On 8/31/05, John Ivanoff <[EMAIL PROTECTED]> wrote:
> > > this might be a start... http://tinyurl.com/ck4wm
> > >
> > >
> > > On 8/31/05, Ryan Everhart <[EMAIL PROTECTED]> wrote:
> > > > Hey All,
> > > > Below is a link to a screen shot of one of my apps that I'm working on..
> > > >
> > > > http://www.godei.com/ss1.jpg
> > > >
> > > > What I need is a JS function that will check all of the check boxes
> > > > for a certain telephone number when the "All" link is clicked. For
> > > > example when someone clicks on the "All" link next to 314-781-0965 all
> > > > of the check boxes with dates next to them would be checked, bud not
> > > > the boxes for the 713-926 number.
> > > >
> > > > The trick is is all one form. I know how to click on ALL and have
> > > > every checkbox checked, but not just selected ones.
> > > >
> > > > Anyone every done something like this?
> > > >
> > > > Thanks,
> > > > Ryan
> > > >
> > > >
> > > > --
> > > > Ryan Everhart
> > > > [EMAIL PROTECTED]
> > > > ----------------------------------------------------------
> > > > To post, send email to [email protected]
> > > > To unsubscribe:
> > > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> > > > To subscribe:
> > > > http://www.dfwcfug.org/form_MemberRegistration.cfm
> > > >
> > > >
> > > >
> > > ----------------------------------------------------------
> > > To post, send email to [email protected]
> > > To unsubscribe:
> > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> > > To subscribe:
> > > http://www.dfwcfug.org/form_MemberRegistration.cfm
> > >
> > >
> > >
> >
> >
> > --
> > Ryan Everhart
> > [EMAIL PROTECTED]
> > ----------------------------------------------------------
> > To post, send email to [email protected]
> > To unsubscribe:
> > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> > To subscribe:
> > http://www.dfwcfug.org/form_MemberRegistration.cfm
> >
> >
> >
> ----------------------------------------------------------
> To post, send email to [email protected]
> To unsubscribe:
> http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
> To subscribe:
> http://www.dfwcfug.org/form_MemberRegistration.cfm
>
>
>
--
Thanks,
Joe Kelly
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm