473,406 Members | 2,954 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,406 software developers and data experts.

Iframe submit issue in Firefox

4
Hello,

I have following scenario in my web application.
I want to load different web forms in single iframe. Iframe in contained in an ASP page. ASP page has “Submit” button, which submits iframe form, & then load new form in same frame.

This is more like slide show of child forms. ASP button also has “Back” button which loads previously submitted form in same iframe. On click of “submit” button, it resubmits child form.

This works fine in IE 6. But in firefox “re-submission” of form does not take place. So that in firefox, child form gets submitted only once.


Sample code

Expand|Select|Wrap|Line Numbers
  1. function setURL(form_url)
  2. {
  3. var iframe = “<iframe id= iframe name= “ + form_label + “ src= ” + form_url;
  4. document.getElementById(“div_name”).innerHTML = iframe;
  5. }
  6.  
  7. function submitForm()
  8. {
  9.     var frameObj = window.frames.form_label;
  10.     if(frameObj.document.childForm)
  11.     {
  12.         frameObj.document.childForm.submit();
  13.             setURL(nextForm_url);
  14.         }
  15. }

above if condition fails in firefox when same child form(i.e with form_label value) is reloaded in iframe. Same code works fine in IE.

Thanks in advanced.
Jul 19 '07 #1
3 3352
gits
5,390 Expert Mod 4TB
hi ...

you posted into the articles-section rather then in the forum ... i moved it across for you ... so that the experts may find and answer it ...

kind regards
Jul 19 '07 #2
I have a very similar problem, i think this is an Firefox bug. I have posted it an i am waiting for an answer...

We have the next situation:
- page with an iframe.
- the iframe contents a function called f().

We want to load the iframe and execute a function inside iframe from outside iframe.


We follow the next steps:

Step 1 - Button "load div_content": Ok.

Step 2 - Execute function f()
Execute function from inside iframe: Ok.
Execute function from outside iframe: Ok.

Step 3 - View location.href of iframe: Ok.
From inside: Ok.
From outside: Ok.

And we go to the beginning:

Step 1 - Reload div_content: Ok.

Step 2 - Execute function f()
Execute function from inside iframe: Ok.
Execute function from outside iframe: ERROR.

Step 3 - View location.href of iframe
From inside: Ok.
From outside: ERROR.


The second time we load the div_content with the same code, the function f() inside iframe is not accessible.

If we load the div_content with the same code changing the name of iframe (idFrame, idFrame2, idFrame3,...) the first load works fine, but if we reload an ancient iframe the function inside iframe is not accessible.

Init.html
-----------------------------------------------------------------------------
[HTML]<html>
<head>
<title>Init</title>
</head>
<body>
<input type="button" value="Step 1- load div_content" onClick="document.getElementById('div_content').in nerHTML='<iframe id=\'idFrame\' name=\'idFrame\' src=\'iframe.html\' ></iframe>'" ><br>
<input type="button" value="Step 2 - execute function f() inside iframe" onClick="window.frames['idFrame'].f()" ><br>
<input type="button" value="Step 3 - view location " onClick="alert(window.frames['idFrame'].location.href);" ><br>
<div id="div_content">
</div>
</body>
</html>[/HTML]


iframe.html
-----------------------------------------------------------------------------
[HTML]<html>
<head>
<title>Iframe</title>
<script type="text/javascript">
function f()
{
alert('Fucntion f().');
}
</script>
</head>
<body>
<input type="button" value="Step 2 - execute function f() inside iframe" onClick="f()" >
<input type="button" value="Step 3 - view location" onClick="alert(self.location)" >
</body>
</html>[/HTML]
Oct 8 '07 #3
CAG
4
I have a very similar problem, i think this is an Firefox bug. I have posted it an i am waiting for an answer...

We have the next situation:
- page with an iframe.
- the iframe contents a function called f().

We want to load the iframe and execute a function inside iframe from outside iframe.


We follow the next steps:

Step 1 - Button "load div_content": Ok.

Step 2 - Execute function f()
Execute function from inside iframe: Ok.
Execute function from outside iframe: Ok.

Step 3 - View location.href of iframe: Ok.
From inside: Ok.
From outside: Ok.

And we go to the beginning:

Step 1 - Reload div_content: Ok.

Step 2 - Execute function f()
Execute function from inside iframe: Ok.
Execute function from outside iframe: ERROR.

Step 3 - View location.href of iframe
From inside: Ok.
From outside: ERROR.


The second time we load the div_content with the same code, the function f() inside iframe is not accessible.

If we load the div_content with the same code changing the name of iframe (idFrame, idFrame2, idFrame3,...) the first load works fine, but if we reload an ancient iframe the function inside iframe is not accessible.

Init.html
-----------------------------------------------------------------------------
[HTML]<html>
<head>
<title>Init</title>
</head>
<body>
<input type="button" value="Step 1- load div_content" onClick="document.getElementById('div_content').in nerHTML='<iframe id=\'idFrame\' name=\'idFrame\' src=\'iframe.html\' ></iframe>'" ><br>
<input type="button" value="Step 2 - execute function f() inside iframe" onClick="window.frames['idFrame'].f()" ><br>
<input type="button" value="Step 3 - view location " onClick="alert(window.frames['idFrame'].location.href);" ><br>
<div id="div_content">
</div>
</body>
</html>[/HTML]


iframe.html
-----------------------------------------------------------------------------
[HTML]<html>
<head>
<title>Iframe</title>
<script type="text/javascript">
function f()
{
alert('Fucntion f().');
}
</script>
</head>
<body>
<input type="button" value="Step 2 - execute function f() inside iframe" onClick="f()" >
<input type="button" value="Step 3 - view location" onClick="alert(self.location)" >
</body>
</html>[/HTML]

I got solution to my problem,

In my case I need to gave unique name to iframe each time.

With this dynamically given name I'm able to access the form loaded in iframe each time.

Thanks for support. :)
Oct 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cont | last post by:
Hi I have the following simple page: <HTML> <TITLE>Test</TITLE> <HEAD> <script language="javascript"> function doSubmit() { alert('test'); window.frames.item(0).updateParent();
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
7
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the...
1
by: XP | last post by:
Hello Everyone, I was stuck with this really frustrating problem for sometime. Let me explain what I am trying to achieve: There is a form and an inner iframe. The form's target is set to the...
4
by: linuskamb | last post by:
I have a problem which is a slight twist on discussions I have seen previously here and elsewhere. I have a form with an input select combo box whose target is an internal static iframe. The form...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
10
by: dmorand | last post by:
I'm having an issue in IE6 (not an issue in IE7 or Firefox) where the file save dialog window isn't appearing. I'm using a hidden iframe to prompt for a download when a user clicks a link. Any help...
23
by: vunet | last post by:
It is recommended by some sources I found to create IFrames in IE using document.createElement('<iframe src="#">') instead of document.createElement('iframe'). Why and what browser versions to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.