Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Firing an event in a parent window ?

Reply
Thread Tools

Firing an event in a parent window ?

 
 
Adrian Parker
Guest
Posts: n/a
 
      08-20-2006
I have a popup window that displays a calendar; it's opened by a button that
relates to a textbox used to enter a date. When the popup is opened, the ID
and the value of the date textbox is passed as an argument. I can update
the date control with the newly selected date, but how then can I trigger a
changed event on the date textbox control from the child calendar window ?
--
Adrian


 
Reply With Quote
 
 
 
 
ozfred@iinet.net.au
Guest
Posts: n/a
 
      08-20-2006
Adrian Parker wrote:
> I have a popup window that displays a calendar; it's opened by a button that
> relates to a textbox used to enter a date. When the popup is opened, the ID
> and the value of the date textbox is passed as an argument. I can update
> the date control with the newly selected date, but how then can I trigger a
> changed event on the date textbox control from the child calendar window ?


If you are changing the text input's value, you must have a reference
to it. If you want to call its onchange handler, then do it. You are
probablly doing something like:

var inputRef = opener.document.getElementById( someID );
inputRef.value = someNewValue;

// Now call onchange
if ('function' == typeof inputRef.onchange) inputRef.onchange();


--
Fred

 
Reply With Quote
 
 
 
 
Adrian Parker
Guest
Posts: n/a
 
      08-21-2006
Thanks. Had to use inputRef.fireEvent('onchange') to get it to work in the
end though.

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
| Adrian Parker wrote:
| > I have a popup window that displays a calendar; it's opened by a button
that
| > relates to a textbox used to enter a date. When the popup is opened,
the ID
| > and the value of the date textbox is passed as an argument. I can
update
| > the date control with the newly selected date, but how then can I
trigger a
| > changed event on the date textbox control from the child calendar window
?
|
| If you are changing the text input's value, you must have a reference
| to it. If you want to call its onchange handler, then do it. You are
| probablly doing something like:
|
| var inputRef = opener.document.getElementById( someID );
| inputRef.value = someNewValue;
|
| // Now call onchange
| if ('function' == typeof inputRef.onchange) inputRef.onchange();
|
|
| --
| Fred
|


 
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
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
dynamic loaded datalist ascx event delegate not firing in parent f cindy ASP .Net 0 09-09-2008 04:16 PM
Nested datagrid event firing - item index of parent grid Andy ASP .Net 1 09-29-2005 08:33 PM
Solution: Raising an Event Handler Postback on Parent Window From Popup Child Window Dialog Box Earl Teigrob ASP .Net 1 06-16-2004 04:19 PM
Popup window to raise event in parent window...can it be done??? Earl Teigrob ASP .Net 4 06-04-2004 11:47 PM



Advertisments