Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1415 How can I show the value of a checked checkbox in a text field?

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>

©2018 Martin Webb