Javascript can't access a textarea field in another window

RESOLVED INVALID

Status

RESOLVED INVALID
14 years ago
2 years ago

People

(Reporter: consultor, Assigned: bugs)

Tracking

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050202 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050202 Firefox/1.0+

The code below is not working.

<script language="javascript">
function selImage(imgName) {
window.opener.frmComment.txtComment.value =
window.opener.frmComment.txtComment.value + ' ' + imgName
}
</script>

It's supposed to send some text to a Textarea in a form in another window, but
it's doing it.

Here's the source code that calls the function:

<IMG SRC="black/smile.gif" onclick="selImage(' :smile: ')"
style="cursor:hand;"></CENTER></TD><TD style="{font-size:11px;}">:smile: ou :) 



Reproducible: Always

Steps to Reproduce:
1) Enter http://cora.blogspot.com
2) Click in any "[x] comentários" link
3) In the bottom of the new opened window, click in 'Smilies' link
4) Choose an smiley by clicking the it's image
5) The smiley text *is not* sent to the opener window
Actual Results:  
Nothing happened.

Expected Results:  
To send some text to a Textarea in a form in another window.

Comment 1

14 years ago
window.opener is a reference to a window. You need a reference to that window's
document. Try
window.opener.document.frmComment.txtComment.value += ' ' + imgName;
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
Product: Firefox → Toolkit
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.