Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4618788
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:20:19+00:00 2026-05-22T02:20:19+00:00

Possible Duplicate: How to call the OnChange event of “Select” ? (Delphi – WebBrowser)

  • 0

Possible Duplicate:
How to call the OnChange event of “Select” ? (Delphi – WebBrowser)

Hi,

I’m loading a web page into a Twebrowser in delphi, the webpage has a form with a drop down. I can get my program to select the item id like in the drop down menu but the select option has a onchange event how can i fire the onchange event in delphi without using execScript(‘yourfunctioname()’, ‘JavaScript’);

heres the select with the onChnage event

<select align="left" id="carrierNameDropDown_UNSHIPPEDITEMS" onChange="MYO.ES.OtherCarrierToggle (this, 'UNSHIPPEDITEMS' )">
          <option value="0"  selected="1" >Select</option>
              <option value="Chronopost"  >Chronopost</option>
              <option value="City Link"  >City Link</option>
              <option value="DHL"  >DHL</option>
              <option value="DPD"  >DPD</option>
              <option value="Deutsche Post"  >Deutsche Post</option>
              <option value="Fastway"  >Fastway</option>
              <option value="FedEx"  >FedEx</option>
              <option value="GLS"  >GLS</option>
              <option value="GO!"  >GO!</option>
              <option value="Hermes Logistik Gruppe"  >Hermes Logistik Gruppe</option>
              <option value="La Poste"  >La Poste</option>
              <option value="Parcelforce"  >Parcelforce</option>
              <option value="Parcelnet"  >Parcelnet</option>
              <option value="Poste Italiane"  >Poste Italiane</option>
              <option value="Royal Mail"  >Royal Mail</option>
              <option value="SDA"  >SDA</option>
              <option value="Smartmail"  >Smartmail</option>
              <option value="TNT"  >TNT</option>
              <option value="Target"  >Target</option>
              <option value="UPS"  >UPS</option>
              <option value="Yodel"  >Yodel</option>

          <option value="Other">
              Specify carrier:
          </option>
        </select>

I got it to work by doing:

if EmbeddedWB1.Document <> nil then begin
if EmbeddedWB1.Document.QueryInterface(IHTMLDocument3,docb) = S_OK then begin
elb := docb.getElementById('carrierNameDropDown_UNSHIPPEDITEMS');
if elb <> nil then begin
(elb as IHTMLSelectElement).value := 'Parcelforce';
OleVariant (elb as IHTMLElement). FireEvent ('onchange');
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:20:20+00:00Added an answer on May 22, 2026 at 2:20 am

    This will work:

    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('carrierNameDropDown_UNSHIPPEDITEMS');
    
          if el <> nil then begin
            (el as IHTMLSelectElement).value := 'UPS';
            (el as IHTMLElement3).FireEvent('onchange', v);
          end;
        end;
      end;
    end;
    

    and this with late binding

    procedure TBrowserPageIE.Test;
    var
      doc : IHTMLDocument3;
      el  : OleVariant;
      v   : OleVariant;
    begin
      if FBrowser.Document <> nil then begin
        if FBrowser.Document.QueryInterface(IHTMLDocument3,doc) = S_OK then begin
          el := doc.getElementById('carrierNameDropDown_UNSHIPPEDITEMS');
          el.value := 'UPS';
          el.FireEvent('onchange', v);
        end;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can I call a new web page from javascript / jQuery
Possible Duplicate: How to solve “call to undefined function domxml_new_doc()…” I'm using php5, when
Possible Duplicate: Show Page Loading Spinner on Ajax Call in jQuery Mobile Is it
Possible Duplicate: Close and Dispose - which to call? Hi, After reading some web
Possible Duplicate: Calling a method named “string” at runtime in Java and C I
Possible Duplicate: how to call RESTful web service from android? This is my web
Possible Duplicate: How to turn a string into a method call? Currently I have
Possible Duplicate: How can I pre-set arguments in JavaScript function call? (Partial Function Application)
Possible Duplicate: How to call one batch file after another I have a batch
Possible Duplicate: How do I call unmanaged C/C++ code from a C# ASP.NET webpage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.