|
<INPUT ...>onClick = "script command(s)"onClickonClick
onClick
<FORM> <TABLE BORDER CELLPADDING=3> <TR> <TD><NOBR>radius: <INPUT NAME="Circle_radius" SIZE=4></NOBR></TD> <TD><INPUT TYPE=BUTTON OnClick="Circle_calc(this.form);" VALUE="calculate"></TD> <TD ALIGN=RIGHT BGCOLOR="#AACCFF"> <NOBR>circumference: <INPUT NAME="Circle_circumference" SIZE=9></NOBR><BR> <NOBR>area: <INPUT NAME="Circle_area" SIZE=9></NOBR></TD> </TR> </TABLE> </FORM>
gives us the "calculate" button in this form:
onClickonClick
<INPUT
TYPE=RESET
onClick="return confirm('Are you sure you want to reset the form?')"
>
gives us
onClickonClick
<SCRIPT TYPE="text/javascript">
<!--
function checkAll(pizzaForm)
{
if(pizzaForm.everything.checked)
{
pizzaForm.mushrooms.checked = true;
pizzaForm.onions.checked = true;
pizzaForm.greenpeppers.checked = true;
pizzaForm.tomatoes.checked = true;
}
}
//-->
</SCRIPT>
<FORM ACTION="../cgi-bin/mycgi.pl">
<INPUT TYPE=CHECKBOX NAME="everything" onClick="checkAll(this.form)">everything<P>
<INPUT TYPE=CHECKBOX NAME="mushrooms" onClick="checkAll(this.form)">mushrooms<BR>
<INPUT TYPE=CHECKBOX NAME="onions" onClick="checkAll(this.form)">onions<BR>
<INPUT TYPE=CHECKBOX NAME="greenpeppers" onClick="checkAll(this.form)">green peppers<BR>
<INPUT TYPE=CHECKBOX NAME="tomatoes" onClick="checkAll(this.form)">tomatoes
<P><INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
which gives us
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.