Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > VCL

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2017, 01:47 PM
frangarrob frangarrob is offline
Junior Member
 
Join Date: Jun 2017
Posts: 1
Default Delphi Fire onchange select object in EmbeddedWB component

Hello.

I'm developing a EmbeddedWB Delphi software.

I need to change a url select object, from default selection to new selection.

I've changed the selection value, by executing javascript code, but there is an onchange event, that doesn't fire...

With Internet Explorer 7, this code works:

Code:
uses 
  MSHTML;

procedure TBrowserPageIE.Test;
var
  doc : IHTMLDocument3;
  el  : IHTMLElement;
  v   : OleVariant;
begin
  if FBrowser.Document <> nil then begin
    if FBrowser.Document.QueryInterface(IHTMLDocument3,doc) = S_OK then begin
      el := doc.getElementById('select');
      if el <> nil then begin
        (el as IHTMLSelectElement).value := 'UPS';
        (el as IHTMLElement3).FireEvent('onchange', v);
      end;
    end;
  end;
end;
But in new versions, since Internet Explorer 11, this code doesn't works...

Have you some idea to fire events??

Thanks.
Reply With Quote
  #2  
Old 06-15-2017, 12:30 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,199
Default

fireEvent is deprecated since IE9 I think.
keyword now is: dispatchEvent

I think a quick google will provide you some valid examples...
Reply With Quote
Reply

Tags
delphi, embeddedwb, events, onchange

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:35 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2017, vBulletin Solutions, Inc.