Checkbox: Mark All, Clear All
I´ve got a basic problem, how to incorporate Javascript to htmldb. Stop! I´ve already read the How-To to this topic, but it doesn´t help in my case. I´ve got the HTML Code to Mark All and Clear All Checkboxes at the end of my text. My question: Where exactly and in which form must I input the several HTML Codes to start my function?
E.g. I think, the different function´s in my code should be placed in the Page Attribute Header Field. Should I create several CheckboxID´s foe each Checkbox or does it suffice to create only one CheckboxID with different Checkboxaccounts?
<html>
<head>
<script>
<!-- Begin
var checkflag = "false";
function check(field)
{
var i;
if (eval(field[0].checked))
{
for (i=0;i<field.length;i++)
field.checked=true;
LL(field);
return "Uncheck All";
}
else
{
for(i=0;i<field.length;i++)
field[i].checked=false;
UU(field);
return "Check All";
}
}
function LL(field){field.disabled=true;}
function UU(field){field.disabled=false;}
</script>
</head>
<body>
<FORM method=post name=f1>
<table>
<tr><td>
<INPUT type=checkbox name=list value="Check All"
onClick="this.value=check(this.form.list);">All<br>
<INPUT type=checkbox name=list value="2">Air<br>
<INPUT type=checkbox name=list value="3">Monitoring<br>
<INPUT type=checkbox name=list value="4">Water<br>
<INPUT type=checkbox name=list value="5">Pollution Prevention<br>
</table>
<INPUT class=lightbluecell style="FONT-FAMILY: verdana, arial, helvetica;
FONT-SIZE: 10px" type=reset value=Clear>
</FORM>
</body>
</html>
I´d be pleased to get a step for step help, because I´m not adepted in this topic.
Thank you very much!