Link to home
Start Free TrialLog in
Avatar of kate99
kate99

asked on

Submit form from different frame

Each method I have used so far seems to ignore the onsubmit event handler on the form in frame1.

Any ideas?

frame1.htm:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" onsubmit="return verify(this);"

action="../screens/xmlCreate.jsp">
<textarea name="field1" cols="50" rows="4"></textarea>
</form>
</body>
</html>

frame2.htm

<html>
<head>
<title>Untitled Document</title>
</head>
<body>
  <a href="javascript:parent.mf_mainFrame.form1.submit();">Submit</a>
</body>
</html>
Avatar of jaysolomon
jaysolomon

<a href="#" onclick="parent.mf_mainFrame.document.form1.submit();return false;">Submit</a>

or

<a href="#" onclick="parent.frames['frameName'].document.forms['form1'].submit();return false;">Submit</a>

Like this:

<a href="#" onClick="if(parent.mf_mainFrame.verify(parent.mf_mainFrame.form1) parent.mf_mainFrame.form1.submit;return false">Submit</a>



Sorry, take this:

<a href="#" onClick="if(parent.mf_mainFrame.verify(parent.mf_mainFrame.form1) parent.mf_mainFrame.form1.submit();return false">Submit</a>


Avatar of kate99

ASKER

Thanks for your reply's.

In the end this worked:

<a href="#" onClick="if(parent.mf_mainFrame.verify(parent.mf_mainFrame.form1))parent.mf_mainFrame.form1.submit();">Submit</a>

What shall i do with the points? Netgroove's answer was nearest. Anyway let me know.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of NetGroove
NetGroove

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You should return false so that the link will not be followed.

>>nearest?

If your not satisfied, then tell us whats not right for you and we will try to suit your needs.

You have 2 options with the points

1 accept the answer that fullfills your requirements.

2 split the points between the experts that helped you.

Good Luck

jAy
Thanks for the points.