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

Q462 Can I copy the input to one form to several others?

You are here: irt.org | FAQ | JavaScript | Form | 10.2 | Q462 [ previous next ]

In the first form add an onChange event handler with call a function call which populates the other fields in the other forms. For example:

<SCRIPT LANGUAGE="JavaScript"><!--
function changeAll(what) {
    for (var i=1; i<10; i++)
        document.forms[i].elements[what.name].value = what.value;
}
//--></SCRIPT>

<FORM>
<INPUT TYPE="TEXT" NAME="field1" onChange="changeAll(this)">
</FORM

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

<FORM>
<INPUT TYPE="TEXT" NAME="field1">
</FORM>

©2018 Martin Webb