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: caching JavaScript files I'm using JQuery 1.7.2 into JSF page. I call
Possible Duplicate: How to call function in every “X” minute? How to periodically call
Possible Duplicate: Call web service from jQuery I want to add two numbers together,
Possible Duplicate: Close and Dispose - which to call? Hi, After reading some web
Possible Duplicate: Call to undefined method mysqli_stmt::get_result My web host has PHP 5.3.10 and
Possible Duplicate: Who should call Dispose on IDisposable objects when passed into another object?
Possible Duplicate: how to call RESTful web service from android? This is my web
Possible Duplicate: web service request call SOAP request missing empty parameters I'm trying to
Possible Duplicate: CakePHP: Call to a member function find() on a non-object I have
Possible Duplicate: How to call javascript function from c# Is there a way to

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.