[dvdvol] select range; source code

Aaron Cannon cannona at fireantproductions.com
Tue Jun 27 06:51:26 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all.  Thanks to those who have volunteered to help with
this.  Here are the relevant code bits:

First the button:
<input type="button" onclick="SetCheckBoxRange('mainform',
'request');" value="Select range">


and then the function:

<script type="text/javascript">
<!--
function SetCheckBoxRange(FormName, FieldName)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
return;
confirm('We're running the function!'); // this line is for debugging.
// I wanted to see if it was even running the function up to that point.
// It didn't pop up, so I don't think it was.
var CheckValue=false;
for(var i = 0; i < countCheckBoxes; i++)
{
if(objCheckBoxes[i].checked && CheckValue == false)
CheckValue=true;
if(!objCheckBoxes[i].checked && CheckValue == true)
return;
objCheckBoxes[i].checked=CheckValue;
}
return;
}
// -->
</script>

As mentioned before, the function will go through the form until it
finds a check box that is checked.  When it finds one, it will
continue to the next checkbox and if it is not checked, it will check
it.  It continues doing this until it either reaches the end of the
form, or until it encounters another checked checkbox.  When it finds
either, it will exit the function.

That's at least what it's supposed to do.

Sincerely
Aaron Cannon



- --
E-mail: cannona at fireantproductions.com
Skype: cannona
MSN Messenger: cannona at hotmail.com (Do not send E-mail to the hotmail address.)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959
Comment: Key available from all major key servers.

iD8DBQFEoTf6I7J99hVZuJcRApCMAKCpnGBGzNIA4e95rb04oh5YrStPXQCdH8Qc
RrpMRYATe8HtYd20I+bzd/Q=
=Lac6
-----END PGP SIGNATURE-----




More information about the dvdvol mailing list