You are here: irt.org | FAQ | JavaScript | Form | 10.1 | Q933 [ previous next ]
Try:
<script language="JavaScript"><!-- function setField(what) { if (what.myTick.checked) what.myText.value = 'checked'; else what.myText.value = ''; } //--></script> <form> <input type="checkbox" name="myTick" onClick="setField(this.form)"> <input type="text" name="myText"> </form>