Hi there,

I am new to javascript. Anyone can help me with this? I need to fill out a form using javascript. It works when the html files is reside in the same directory but it doesn't if it's in another site (both are the same file), it give me an error of "Access is Denied". I am using frames to do it. There are a frame call "leftFrame" and another one call "mainFrame".

The following are the codes for the main frame:
<frameset cols="100,810*" frameborder="YES" border="0" framespacing="0" rows="*" bordercolor="#FFFFFF">
<frame name="leftFrame" src="1.html" frameborder="No" bordercolor="#FFFFFF" noresize scrolling="NO">
<frame name="mainFrame" src="">
</frameset>

This is the code for the javascript to fill out the form.
function test1(){
top.mainFrame.document.forms[0].loginName.value = 'Test 1 name';
top.mainFrame.document.forms[0].password.value = 'test1password';
}

Please check out this URL http://www.geocities.com/jscript2001/main.html. All the files are there. Can anyone guide me to modify the Javascript so I can fill out the form in another site?

Thanks for your time.