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

Q1705 Can I submit a form in a parent window by clicking a submit button in a child window?

You are here: irt.org | FAQ | JavaScript | Window | Q1705 [ previous next ]

Try:

<html>

<head>
<script language="JavaScript"><!--
var windowReference;

function openPopup() {
  windowReference = window.open('popup.htm','windowName');
  if (!windowReference.opener)
    windowReference.opener = self;
}
//--></script>
</head>

<body>

<form name="formName" onSubmit="alert('submit triggered')">
</form>

</body>

</html>

And then in popup.htm:

<form>
<input type="button" value="Submit" onClick="opener.document.formName.submit()">
</form>

Feedback on 'Q1705 Can I submit a form in a parent window by clicking a submit button in a child window?'

©2018 Martin Webb