Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iframe issue

Status
Not open for further replies.

iggitme

IS-IT--Management
Sep 13, 2006
47
US
I am using the following code.. (please don't say I should just change to ajax or something else, this was a decision made for various reasons and not in my control, so its built using iframes)

I would place a link here but i can't.. its secured content, and requires an account to access it.

there is a popup that opens this popup so the parent is in question at this stage...

I have an iframe named 'publish' and an iframe named 'hide', within a window named 'SD'. 'hide' is just that, processes that do not result in visible page contents, while 'publish' houses the viewable result.. it happens in two js

<SCRIPT language="JavaScript">
function submitform1()
{
document.myForm.target = "publish";
document.myForm.submit();

}
</SCRIPT>

sends to the publish iframe, but it is not.. it is opening a new window

following that execution... a second call is to

parent.hide.location.href = 'index.cgi?z=sd&int=publish';

what is happening is the hide call is working, the publish call is opening a new window, which spawns a new window which shows the result in the new window instead of in the iframe 'publish'

do i need to point these better? how can i get the 'publish' to actually target the 'publish' iframe.. the other one seems to be just fine

any help will be greatly appreciated.. i have tried various combinations and directions to no avail

thank you
 
Nobody? Is more info needed? What can I do to make this stop opening two windows one spawning the other.
 
Your Js seems o.k.

We need more info. We need to look a your html code. specifically the iframe.

The only reason I can think of that would cause your code to open a new window is if your iframe's name is not Publish.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
iframes

<iframe name=publish id=publish src="sd.cgi?int=publish" frameborder=0 border=0 style="margin-top:5px;height:25px;width:550px;"></iframe>


<iframe name=hide id=hide style="width:0px;height:0px;" src="index.cgi?w=front" frameborder=0 border=0></iframe>


the form tag does have an action, i thought perhaps two submissions, one js one not.. took it out... no change.. then, changed iframe names, put it all back correctly, then checked each one individually after running the app, then stood back and thought tek-tips.

Thank you for the curiosity. I'm not alone in this one, whew!
 
The form should look figuratively like this.
[tt]
<form name="myForm" action="youraction">
<!-- other elements -->
<input type="button" onclick="submitform1()" value="somevalue" /><br />
<!-- other elements -->
</form>
[/tt]
or, if you put it as submit handler, it would be minimally like this.
[tt]
<form name="myForm" action="youraction" onsubmit="submitform1();return false;">
<!-- other elements -->
<input type="submit" value="somevalue" /><br />
<!-- other elements -->
</form>
[/tt]
Does yours ressemble the above?
 
yes they do, but they use onblur to fire the processes

i'm wondering if onblur is a culprit here... although i can't figure a moment where that would be the case
 
Can we see your form?






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
onblur couldn't be the culprit. Watch if the there are nested onblur events so that it bubbles?
 
please forgive me guys i don't have the scheduled time to address this immediately, i will do so when the schedule is done for the day... will post the form being used, as well as check for nested events... i don't think so though.. although that has always wound up screwing assumptions up in the past... thank you for your interest
 
OK I am sorry this took so long.. (whew am I ever, it took way too long) ..

Form: headers missing as this is module stuff, and some changes in 'way' above calls based on the most recent experimentational disaster...

<SCRIPT language="JavaScript">
function submitform1()
{
document.myForm.target = "loc";
document.myForm.submit();

}
</SCRIPT>
</form>
<form action=index.cgi method=post name=myForm target=loc>
<input type=hidden name="w" value="saveLOC">
<input type=hidden name="z" value="sd">
<table border=0 cellpadding=0 cellspacing=0 bgcolor=#eeeeee valign=top><tr><td width=170px bgcolor=#eeeeee>

---

<div style="width:170px;height:35px;font-size:11px;margin-top:5px;font-size:11px;font-weight:600;background-color:#eeeeee;color:#333333;" title="$ititle"><span align=left><b>Location(s) With Sale Price<br></b></span></div>
</div>
</td><td bgcolor=#eeeeee colspan=2 width=420px>
<select name="locations" multiple style="font-size:10px;width:350px;height:35px;" onblur="parent.publish.location.href = 'index.cgi?z=sd&int=publish';">


---

it closes elsewhere and that is fine for all other applications using it


---

thank you for continued interest, nice thing is, it is making the rest of the process go more quickly, although this process does chain on down the line and i'm afraid it is driving me to sanity...

 
Am interested only if you're interested. What has the above to do with submitform1()?
 
Sorry 'bout that. Like I said it was the latest version after some vain attempts and that was indeed one of the differences... so I am sorry it was that one, as it was rather important to the initial question.

In the section of <select name="locations" is an onblur, it was there, until this attempt to stop the problem resulted in easier to write in the onblur than switch settings to manage the js file as well.

submitform1() goes there, when the other is removed from it.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top