Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Submit form from different frame

Posted on 2003-11-17
7
Medium Priority
?
1,484 Views
Last Modified: 2012-06-27
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>
0
Comment
Question by:kate99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9764935
<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>

0
 
LVL 10

Expert Comment

by:NetGroove
ID: 9765168
Like this:

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



0
 
LVL 10

Expert Comment

by:NetGroove
ID: 9765175
Sorry, take this:

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


0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:kate99
ID: 9769696
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
0
 
LVL 10

Accepted Solution

by:
NetGroove earned 200 total points
ID: 9769947
What does mean nearest?
If you do not add ";return false"  that it is false but error tollerant.
Clicking on a <a> link will load the window with the link in the href.
The return value kills that default window load behaviour.

The naswer from jaysolomon  circumvents the validate()  function and submits only the form.

So does my proposal solve your problem.

By the way, there are more elegant ways doing what you want to do, but I prefered not to confuse you with details and keep the things like they are actually.



0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9771026
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
0
 
LVL 10

Expert Comment

by:NetGroove
ID: 9782468
Thanks for the points.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question