Print Page | Close Window

Javascript object editing

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=14546
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript object editing
Posted By: ub3rl337ch3ch
Subject: Javascript object editing
Date Posted: 04 April 2005 at 1:44am
I know that the properties of an object can be edited by using javascript, along the lines of window.document.form.field.value="blah"
but i was wondering whether it is possible to alter to properties of an object in another window? along the lines of maybe computer.window2.form.field.value="blah" or is window the highest level js can go to?



Replies:
Posted By: dj air
Date Posted: 04 April 2005 at 5:54am
i believe you can set window to anything that is a window

so self.document.form.element1.value = "blahh"

does the windoiw it is in

TopNav.document.form.eleement1.value="blahh"

that would look in a window called TopNav


Posted By: ub3rl337ch3ch
Date Posted: 04 April 2005 at 6:43pm

how do you determine what a window is called? is it the name of the file open in that window?



Posted By: dj air
Date Posted: 04 April 2005 at 7:47pm
within the frame set you set a name to each frame window.



<frameset rows="200,*,63" cols="710" frameborder="NO" border="0" framespacing="0">
  <frame src="/Templates/top.asp" name="topFrame" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0" >
  <frameset rows="*" cols="*,100,510,100,*" framespacing="0" frameborder="NO" border="0">
    <frame src="/Templates/blank.asp" name="blank1" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0"> 
    <frame src="/Templates/side_bars.asp" name="leftFrame" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0">
    <frame src="/display.asp" name="Display" frameborder="no" noresize marginwidth="0" marginheight="0" id="Display">
   
     <frame src="/Templates/side_bars.asp" name="leftFrame" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0">
         <frame src="/Templates/blank.asp" name="blank 2" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0">
  </frameset>
  <frameset rows="55" cols="*,710,*" frameborder="NO" border="0" framespacing="0">
           <frame src="/Templates/blank.asp" name="BottomBlank1" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0">
    <frame src="/Templates/bottom.asp" name="BottomFrame" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0" >
           <frame src="/Templates/blank.asp" name="BottomBlank2" frameborder="no" scrolling="NO" noresize marginwidth="0" marginheight="0">
</frameset>
</frameset>
<noframes>
<body>
</body></noframes>


in the above code we have the name tag each name tag is a window so to launch/do something in those windows you put the name of the window for example BottomBlank2


also you can name pop up windows when they are created to launch script within them

or you can focus on a window that opened that window using window.opener.focus or another command


Posted By: ub3rl337ch3ch
Date Posted: 04 April 2005 at 8:14pm
so:
I have window1 which uses js to open window 2
window1 contains a form called form1 and a field called field1
i want to call this field from window 2
 
would i go "window.opener.focus.form1.field1"?


Posted By: Gullanian
Date Posted: 05 April 2005 at 5:28am
I think it's something like parent.form or something.  Lookup 'Javascript Parent Window Forms' on Google or something like that.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net