Fire an event to a Form.Element.EventObserver using PrototypeJS
Basically, I have the same question as this one below:
http://www.mail-archive.com/prototype-scriptaculous@googlegroups.com/msg08682.htmlIn my case, I get this event observer:
new Form.Element.EventObserver( "selectId", function(element, value) {new Ajax.Updater('divId', '/path/1111', {asynchronous:true, evalScripts:true, onComplete: function(request, json){...}, parameters:'...'});});
I have no former experiences with Protot开发者_如何学Cype framework. Can someone tell me, after changing the value of 'selectId', how can I fire 'onChange' event on <select id='selectId'> control?
I have already tried 'Event.fire()' and 'selectId.onChange()' without any luck.
BTW, I cannot change the source code of that page. I need to write some javascript code in address bar in this format: "javascript: xxx".
It is possible with event.simulate.js as discussed in this question.
Since you are trying to do it via the address bar you'll have to first include the remote file in a manner similar to this question and answer.
Event.fire()
only works for custom events, not native ones. Unfortunately.
精彩评论