Help with Javascript for FireFox

M

Mark

Hi - I have the script below, which is supposed to populate a text box
on a form which opened this popup window - it should then call a
function 'PostThisPage' on the opener document, and then close the
current window/popup.

This works ok in IE - can anyone please help me by pointing out what it
needs to become cross-browser compatible? It doesn't work in Firefox
1.0.

Thanks for any help, Mark

<script>
window.opener.document.forms(0).tbGoToDate.value = '2004-11-11';
window.opener.PostThisPage();
window.close();
</script>
 
M

Michael Winter

[snip]

Not related to the solution, but the SCRIPT element requires the type
attribute:

window.opener.document.forms(0).tbGoToDate.value = '2004-11-11';

The forms property is a collection - think "array". You use square
brackets to subscript collections, not parentheses:

opener.document.forms[0]

You could go one step further and use the elements collection, too:

opener.document.forms[0].elements['tbGoToDate']

[snip]

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top