Jump to content
mipmz

Cannot fire this dropdown though I can change it's value

Recommended Posts

This 'Select' element is on my bank account's page so I can't provide the url.

I found an example page at http://events.msdn.microsoft.com where, again,  I can change the value of any dropdown but unable to fire/update the page.  I've done many searches but never found a similar problem.  Please point me in the right direction. Below is the html and what I have tried already.

I have tried the following:

#include <ie.au3>

Local $oIE = _IEAttach("Account Activity")
Local $oForm = _IEFormGetCollection($oIE,0)
Local $oSelect = _IEGetObjById($oForm,"StatementPeriodQuick")
; Any of these 3 methods work to select the 5th item "All Transactions"
_IEFormElementOptionSelect($oSelect,"ALL",1,"byValue",1)
_IEFormElementOptionSelect($oSelect,"All Transactions",1,"byText",1)
_IEFormElementOptionSelect($oSelect,"4",1,"byIndex",1)

;Nothing happens when I try any of the following
_IEAction($oSelect, "focus")
$oSelect.fireEvent("onSelect")
$oSelect.fireEvent("onselectstart")
$oSelect.fireEvent("onchange")
$oSelect.fireEvent("onclick")
$oSelect.fireEvent("onmousedown")
$oSelect.fireEvent("onmouseup")

;Submitting the form just refreshes the page with the defaults
;_IEFormSubmit($oForm)
<select name="StatementPeriodQuick" tabIndex="115" class="chaseanalytics-track-option" id="StatementPeriodQuick"><option value="SINCE_LAST_STATEMENT" data-pt-name="stmtquick_sincelaststmt">Since Last Statement</option>
<option value="LAST_STATEMENT" data-pt-name="stmtquick_1monthsago">Statement Ending Mar 11, 2015</option>
<option value="TWO_STATEMENTS_PRIOR" data-pt-name="stmtquick_2monthsago">Statement Ending Feb 11, 2015</option>
<option value="THREE_STATEMENTS_PRIOR" data-pt-name="stmtquick_3monthsago">Statement Ending Jan 11, 2015</option>
<option value="ALL" data-pt-name="stmtquick_all">All Transactions</option>
</select>

EDIT: I did a couple more queries and came upon my solution.

After changing the SELECT value, add these 3 lines of code:

 
$oEvt = $oIE.document.createEvent("HTMLEvents")
$oEvt.initEvent("change", True, False)
$oSelect.dispatchEvent($oEvt)
 
See here for details: (there a 2nd possible solution also)

'?do=embed' frameborder='0' data-embedContent>>

Edited by mipmz

Share this post


Link to post
Share on other sites

Ive had some combo box issues myself.

See my thread where I found a solution for my specific case:

Also some boxes DONT update until you fire a blur event.

eg. focus event, change value, blur event. And then the page accepts it on the blur.

 _ieaction( $object, "focus)  and _ieaction( $object, "blur" )

Edited by sherkas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...