Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help with Javascript for FireFox

Reply
Thread Tools

Help with Javascript for FireFox

 
 
Mark
Guest
Posts: n/a
 
      11-09-2004
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>






*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      11-09-2004
On 09 Nov 2004 22:46:51 GMT, Mark <(E-Mail Removed)> wrote:

[snip]

> <script>


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

<script type="text/javascript">

> 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

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      11-10-2004
Thanks Mike - that works perfectly in IE and Firefox.

Cheers, Mark



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Javascript not working in Firefox "event not defined" Wiseman Javascript 1 07-25-2008 03:04 PM
Firefox Javascript Help!! :( Joseph Javascript 9 03-13-2008 10:46 AM
Javascript / FireFox help needed DutchMaster11 Javascript 9 07-30-2007 09:18 PM
Javascript / FireFox help needed DutchMaster11 HTML 4 07-21-2007 04:04 AM
Javascript tabindex forcing working fine in Firefox but not IE, HELP please! ScottRoot2@gmail.com HTML 2 01-10-2007 04:14 AM



Advertisments