/    Sign up×
Community /Pin to ProfileBookmark

javascript and frames

Hi. I want to ask a question : can I access by javascript an element ,
like
document.forms[i].elements[j] – but when I use frame (may by
window.frame …) .I will be very happy to hear something about
that.Thanks. Valentine.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@NevermoreApr 08.2003 — If I understand you coorectly, then the answer is yes, you can access other frames on a page. Just replace [I]document[/I] with the frame name. E.g. topframe.form. etc
Copy linkTweet thisAlerts:
@requestcodeApr 08.2003 — I believe the format is:

parent.frame_name.document.form_name.field_name.value

or

top.frame_name.document.form_name.field_name.value

or if it is the first frame and the first form and the first element then this would work:

parent.frames[0].document.forms[0].elements[0].value

second frame:

parent.frames[1].document.forms[0].elements[0].value
Copy linkTweet thisAlerts:
@NevermoreApr 08.2003 — You don't need all that unless you're dealing with multiple windows.
Copy linkTweet thisAlerts:
@durgaApr 09.2003 — Hi,

I've a question regarding frames.

In my application I've 2 frames which contain 2 jsp page.

When I resize the window (minimize or maximize) some of javascript functions written in the jsp pages not found.But when I click on page source option of browser it shows all the javascript functions.

And when I reload the page it works fine.

could you suggest something on this ?

Thanks in advance.
×

Success!

Help @Djamboff 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.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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