470,604 Members | 2,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,604 developers. It's quick & easy.

frames and forms

i'm trying to use javascript to change the content of a textbox in a
different frame.

by clicking on a 'folder' link in 'leftFrame' i want to put the value
assigned by that link into the 'folderName' textbox in the
'uploadForm' form in 'mainFrame'. i'm doing this as...

onClick="parent.mainFrame.uploadForm.folderName.va lue='folder';"

this works perfectly fine with IE and Safari on my Mac OS X machine
and IE 6 on my PC laptop but anything Mozilla-based on either machine
gives me an error i just can't seem to get round...

'parent.mainFrame.uploadForm has no properties'

has anyone got any ideas why and what i can do about it, please?

many thanks

joe
Jul 20 '05 #1
1 1690
js*****@btclick.com (JoeBaker) writes:
'parent.mainFrame.uploadForm has no properties' has anyone got any ideas why and what i can do about it, please?


You use the name of the form as a global variable. There is no reason
to believe that that should work, except that IE decided to allow it.
Try the fully qualified path:

parent.frames['mainFrame'].document.forms['uploadForm'].
elements['folderName'].value = ...

It is always safer to use the appropriate collections.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Billy Jacobs | last post: by
2 posts views Thread by Yve | last post: by
3 posts views Thread by Ike | last post: by
11 posts views Thread by Jamie Dulaney | last post: by
1 post views Thread by dudu | last post: by
3 posts views Thread by misra.manisha | last post: by
1 post views Thread by troytabor | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.