/    Sign up×
Community /Pin to ProfileBookmark

struggling for this…pl help…

i have a frameset with 3 frames.
frame1 has some buttons
frame2 will show results
frame3 is hidden

On click of button3 in frame1, i submit a form in the hidden frame frame3 and target the results to a pop-up window.

my code for this is:
in frame2 i have a function onclick:
function popupAddlColumnDialog() {

window.open(“”,”addColumnsWindow”,”width=700px,height=700px,scrollbars=yes,status=no,menubar=no,toolbar=no,resizable=no,center=yes,location=no”);

parent.frame3.doOnClick();
}

in frame3 doOnclick():
function doOnClick() {
document.getElementById(“form3name”).submit();
}

all these work perfectly fine.

the problem is…..
there is a function in frame1 which i want to call in my popup…

i tried: (in my onload function of the popup)window.opener.parent.criteriaFrame.savedSearchName.value;

in the popup i have:
function performOnLoad()
{
var l_savedSearchName = window.opener.parent.criteriaFrame.savedSearchName.value;
document.addColumn.savedSearchName.value = l_savedSearchName.value;
self.focus();

}

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliSep 17.2003 — Seems like you want to call a JS function from popup???

if so then code below will do that

window.opener.parent.criteriaFrame.JSFunctionName();

it should work otherwise replace window with top

top.opener.parent.criteriaFrame.JSFunctionName();
Copy linkTweet thisAlerts:
@suganyaauthorSep 17.2003 — thanks for ur reply....

i tried both with window and top....they dont work...

var l_savedSearchName = top.opener.parent.criteriaHeader.getSavedSearchName();

document.addColumn.savedSearchName.value = l_savedSearchName.value;

i keep getting top.opener is null or not an object.....

am i getting this problem bcos i am submitting my form to a hidden frame and then opening up the popup?....
Copy linkTweet thisAlerts:
@Khalid_AliSep 17.2003 — I am hoping that in this line of code

top.opener.parent.criteriaHeader.getSavedSearchName();

criteriaHeader

is the name of the frame???

whats the error you are getting
Copy linkTweet thisAlerts:
@suganyaauthorSep 17.2003 — frame1 is criteriaHeader - thats where the function is....

frame2 is criteriaFrame - thats where the button is....

frame3 is hiddenFrame - thats where i submit the form

i am getting the foll error:

top.opener is null or not an object.....

or if i replace it with window then:

window.opener is null or not an object.....

thanx..
Copy linkTweet thisAlerts:
@Khalid_AliSep 17.2003 — My suggestionworks,however in your case its not,that means the problem might be somewhere else in your design.

post a link to the site where you have all of those frames,or zip all of the resources and upload the file so that some one can see whats wrong with which part of your code.
×

Success!

Help @suganya spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...