Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Frame | Q1055 [ previous next ]

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

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.