You are here: irt.org | FAQ | JavaScript | Form | Q1415 [ previous next ]
Try:
<form> <input type="checkbox" value="yes" onClick="if (this.checked) this.form.myText.value=this.value; else this.form.myText.value=''"> <input type="text" name="myText"> </form>