Forum Moderators: open

Message Too Old, No Replies

writing a textbox to another frame onclick

writing a textbox to another frame onclick

         

haryanto

2:07 am on Mar 3, 2005 (gmt 0)

10+ Year Member



OK guys,

I am trying to use a button on a menu frame to enter a value to a textbox of another frame onclick.
I think my code is OK, but somehow it doesn't work.
Whats the missing link?

TOP


<frameset cols="100,*" frameborder="NO" border="0" framespacing="0">
<frame src="src.php" name="mainFrame">
<frame src="http://mail.yahoo.com/" name="rightframe" scrolling="NO" noresize>
</frameset>

MENU FRAME

<a onclick="top.rightframe.document.getElementByName('login').value='dummyname'">click here to enter login name</a>

birdbrain

11:33 am on Mar 3, 2005 (gmt 0)



Hi there haryanto,

try it like this...

[blue][1]<a href="javascript:void(parent.rightframe.document.getElementBy[3]Id[/3]('login').value='dummyname')" >click here to enter login name</a>[/1][/blue]

..note that this requires that the form element must have id="login" added to it

birdbrain

haryanto

8:59 pm on Mar 3, 2005 (gmt 0)

10+ Year Member



Why id instead of name? I am targeting the lement with name "login" so I thught it is better to use getlementbyname.

Anyway Its still not working.
My javascript console still showing
Error: uncaught exception: Permission denied to get property HTMLDocument.getElementById

haryanto

9:53 pm on Mar 4, 2005 (gmt 0)

10+ Year Member



Anyone pls help me with this?
Or at least tell me if its possible.

Thanks in advance, JS gurus.