Welcome to Dream.In.Code
Become an Expert!

Join 149,863 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,266 people online right now. Registration is fast and FREE... Join Now!




Onsubmit Problem When Form Submitted From Other Fr

 
Reply to this topicStart new topic

Onsubmit Problem When Form Submitted From Other Fr

philiprakusen
14 Feb, 2005 - 03:33 AM
Post #1

New D.I.C Head
*

Joined: 9 Dec, 2004
Posts: 21

I am having problems getting a popup to open from an onSubmit function when the form is being submitted from another frame.

Basically, I have two frames. In one frame I have a form and a JavaScript function, and the other frame contains a submit button (unfortunately this layout, albeit unorthodox, is essential).

FRAME ONE:
<script language="JavaScript">
<!--
function openPopup() {
window.open('index.htm');
return false;
}
//-->
</script>

<body>
<form name="myform" method="post" onsubmit="return openPopup();">

</form>
</body>


FRAME TWO:
<script language="JavaScript">
<!--
function submitTheForm() {
parent.right.myform.submit();
}
//-->
</script>

<body>
<a href="#" onClick="submitTheForm();"><img src=”myimage.gif”></a>
</body>


The button in frame two successfully submits the form BUT the openPopup function does not run. Is this a known problem?

Any ideas how to fix?

I also need to pass the input values from the form elements to the new window.

This post has been edited by philiprakusen: 14 Feb, 2005 - 04:58 AM
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Onsubmit Problem When Form Submitted From Other Fr
14 Feb, 2005 - 06:01 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,351



Thanked: 51 times
Dream Kudos: 25
My Contributions
When you call a function from a frame other than the one it's in, you'll have to specify the frame name as well...

Also, try putting an alert statement in the function, first thing, just to see if the function IS being called, but not performing as exepcted.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:58AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month