473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

submitting a form within an Iframe

Hello,

I have a form inside an iFrame which I want to submit with javascript
as the iframe loads.
For example:

<iframe src="" name="myiframe" id="myiframe>
<form method="post" id="myform" name="myform" action="http://
www.yahoo.com" target="_self">
</form>
</iframe>

No matter how I try to submit the form I cannot get it.
I'm getting null on:
- document.getElementsByName("myform") ,
- document.myiframe.myform
all other combinatinos I try gives the same, i cannot access the form.

Can you please assist me getting this working ?
Thanks!
Tal.

Mar 18 '07 #1
2 5879
On Mar 18, 1:21 am, talta...@gmail.com wrote:
Hello,

I have a form inside an iFrame which I want to submit with javascript
as the iframe loads.
For example:

<iframe src="" name="myiframe" id="myiframe>
<form method="post" id="myform" name="myform" action="http://www.yahoo.com" target="_self">
</form>
</iframe>

No matter how I try to submit the form I cannot get it.
I'm getting null on:
- document.getElementsByName("myform") ,
- document.myiframe.myform
all other combinatinos I try gives the same, i cannot access the form.

Can you please assist me getting this working ?

Thanks!
Tal.
It looks like your problem is getting a reference to the iframe, not
the submitting.

It turns out that getting that reference can be quite tricky.

There's a good article about it here:
http://www.quirksmode.org/js/iframe.html

-Jeff

Mar 18 '07 #2
Jeff wrote:
On Mar 18, 1:21 am, talta...@gmail.com wrote:
>Hello,

I have a form inside an iFrame which I want to submit with javascript
as the iframe loads.
For example:

<iframe src="" name="myiframe" id="myiframe>
<form method="post" id="myform" name="myform" action="http://www.yahoo.com" target="_self">
</form>
</iframe>
You can't put content into an iframe inline, they don't work like that. They are little individual browser windows. They have an src attribute which you set to draw their content from a URL.
Mar 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ben | last post by:
Hi, I'm having trouble with the CSS apparently not working fully on the form input fields when inside an iFRAME. The problem is that if I resize the text size on the test.html page(see below)...
5
by: Victor | last post by:
Hi I need to open an html file from the file system and embed that html file within my main aspx form. I have 2 questions: 1) How do I open the html file? I tried the File.open(Path, mode) didnt...
10
by: Noozer | last post by:
Below is some ASP, HTML and javascript. It is part of a page used to maintain a small database. This code did work at one time, but has since stopped. For some reason the data on my form is not...
3
by: Bob | last post by:
I'm a total newbie at Javascript, but a programmer for over 20 years... so, my plans may be bigger than they are possible. I'm trying to set with Javascript the value of a form field... easy...
1
by: Naim | last post by:
hi I have this situation where I need to do some server side execution without posting the page. I used to do this in asp using IFrame, but it's not working in asp.net. I had a form and...
2
by: Jon | last post by:
All, I'm currently working with a PHP-based CMS application, and am begining to put the finishing touches on it via Javascript validation. Currently, I'm using fairly standard methods of...
7
by: FP | last post by:
This should be simple but I just can't seem to figure it out. I have a form with 2 checkboxes in it. Clicking either checkbox runs a js function which opens a new window. The form targets that...
4
by: paratge | last post by:
Hi, I'm updating one form in an iframe, with another in a main page. That works fine, th probliem is how to submit two forms with one click. For now i get an error "permission denied" how can...
3
by: erobinso | last post by:
I have a page that makes use of a tiny/hidden IFRAME that becomes triggered to load HTML into a SPAN element (via .innerHTML). The SPAN expands to display a form that then needs to be validated with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.