Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1055 How can I place the link text on a link in a form field in another frame?

You are here: irt.org | FAQ | JavaScript | Frame | Q1055 [ previous next ]

Try something like:

<FRAME SRC="page1.htm" NAME="otherFrameName">
<FRAME SRC="page2.htm">

And then in page1.htm:

<FORM NAME="formName">
<INPUT TYPE="TEXT" NAME="fieldName">

And then in page2.htm:

<SCRIPT LANGUAGE="JavaScript"><!--
function functionName(text) {
    parent.otherFrameName.formName.fieldName.value = text;

<A HREF="javascript:functionName(this.text)">link text</A>

©2018 Martin Webb