Hi,
I'm using javascript to auto check checkboxs when I check 1 (like hotmails delete all option). I'm using the following javascript.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field.checked = true;}
checkflag = "true"; }
else {
for (i = 0; i < field.length; i++) {
field.checked = false; }
checkflag = "false"; }
}
// End -->
</script>
and using this to execute it
<input type=checkbox value="true" onClick="this.value=check(this.form.checkbox)" name="delete">
My problem is, my checkboxs are created dynamically and are called..
checkbox[1]
checkbox[2]
checkbox[3]
etc
Which doesn't work with the script. Is there anyway I can get javascript to recognise the checkbox names?