Solved

submit a form from another frame

Posted on 2000-03-02
5
240 Views
Last Modified: 2010-04-09
Hi......
How can I submit the form thats on frame 1 when I click a href thats in frame 2.
0
Comment
Question by:rickyr
[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
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 50 total points
ID: 2576321
First they both have to be on the same domain, otherwise you won't have permission to do it (security violation).

The link on frame 2:
<A HREF="JavaScript:void(0);" onClick="top.frame1.formname.submit(); return false;">

Frame1 is the name of frame 1, and formname is the name of the form.  Change these as necesary.

-Josh
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2576331
Oops.  needs to be:
<A HREF="JavaScript:void(0);" onClick="top.frame1.document.formname.submit(); return false;">

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2576430
looks good, but what about the HREF query string I already have in there? What should I do with that?
Thanks
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2576499
You have something else going on in the href, or in the form?
If it's just the link, you can leave what you have in the href, and change the onClick event to return true.  That way the href default action will still take place.

-Josh
0
 
LVL 3

Author Comment

by:rickyr
ID: 2623066
Ta
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

628 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