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

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

irt.org | Knowledge Base | JavaScript | Window | Q1705 [ previous next ]

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

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?'


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.