Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drop Down not really being selected
#1
I have code that will pick a filter for an online report from a drop down list. The option I want is selected, but when the report is run the filter is not actually being used. I talked to the web site designer and there is an onclick being used that updates the page prior to sending the request to the database. Is there someway to emulate this onclick option? Here is the code I am sending:

MSHTML.IHTMLElement el=htm("SELECT" "FundedProgram_cboList" "" "Internet Explorer" 0 0 0x121)
MSHTML.IHTMLSelectElement elsel1=+el
elsel1.selectedIndex=indx
wwhat = elsel1.selectedIndex
if(val(wwhat)=-1) end

The indx is a number that is passed in.

Thanks for all your help as always!
#2
Try to insert this after third line.

Code:
Copy      Help
MSHTML.IHTMLElement3 e3=+elsel1
e3.FireEvent("onclick")
e3.FireEvent("onchange")
;try onclick or onchange or both

Works with IE 5.5 and later.
#3
As always you are right on track. Thanks for the quick and easy fix.


Forum Jump:


Users browsing this thread: 1 Guest(s)