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

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:

<FRAMESET ROWS="50%,*">
<FRAME SRC="page1.htm" NAME="otherFrameName">
<FRAME SRC="page2.htm">
</FRAMESET>

And then in page1.htm:

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

And then in page2.htm:

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

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

©2018 Martin Webb