Solved

submit a form from another frame

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send Mail Via SMTP Replacement/Rework 11 60
I need help embedding an image as HTML in my vb.net application 3 48
WordPress Themes 10 34
Centering Vertically 3 27
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

919 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

18 Experts available now in Live!

Get 1:1 Help Now