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

Q9 How do I make a button that when clicked displays a message in a field?

You are here: irt.org | FAQ | JavaScript | Form | 10.1 | Q9 [ previous next ]

<form name="formName" onSubmit="return functionName();">
<input type=text name="textName">
<input type=submit value="Display">
</form>
<script language="JavaScript"><!--
function functionName() {
    window.document.formName.textName.value = 'hello world';
    return false;
}
//--></script>

©2018 Martin Webb