Solved

submit a form from another frame

Posted on 2000-03-02
5
202 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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)

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now