Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

submit a form from another frame

Posted on 2000-03-02
5
Medium Priority
?
251 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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

782 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