AJB

IE: Trigger event on _IEFormElementOptionSelect to display hidden div.

3 posts in this topic

Hello, and thank you for your input. I've been searching around to try to find out how to trigger a change when selecting an option from a dropdown using _IEFormElementOptionSelect, but haven't found anything in the forums or via google.

Here is my sample code:

;Select the lead type
$LeadType = _IEGetObjByName($oIE, "data[leads_types]")
$LeadType.focus
_IEFormElementOptionSelect($LeadType, "Expired", 1, "byText")

This works to select the value, but it doesn't trigger a date range div that is set with display:none. When done manually there is an event trigger where jquery changes the display setting.

The HTML for the dropdown:

<select name="data[leads_types]" class="selectbox leadselectbox" style="width:140px;" id="lead_options">
<option value="">Lead Type</option>
<optgroup label="Leads">
<option value="1">Divorce</option>
<option value="27">Empty Nesters</option>
<option value="24">Estate Sales</option>
<option value="18">Evictions</option>
<option value="2">Expired</option>
</optgroup>
<optgroup label="CRM">
<option value="11">Cold Lead</option>
<option value="20">Dead</option>
<option value="13">Follow Up Lead</option>
<option value="12">Hot Lead</option>
</optgroup>
</select>

The Html for the div that gets displayed:

<div id="date_selection" style="display: none;float: left;margin-left: 5px; width:390px; ">
      <div style="float: left;font-size:15px">       
        From: <input class="inputTxt3 dtpicker hasDatepicker" style="width:80px;" size="25" name="offer_from_date" id="offer_from_date" value="08/26/2015" type="text"> 
        To: <input class="inputTxt3 dtpicker hasDatepicker" style="width:80px;" size="25" name="offer_to_date" id="offer_to_date" value="09/10/2015" type="text">
     </div>   
     <div style="display: block; float: left;margin-left: 5px;font-size:13px" id="searchTypeDiv">
        <span title="Search for Recorded or Filed Dates">Record Date</span> <input type="radio" name="searchDateType" value="r">
        <br>
        <span title="Search for the date RG found the record">Insert Date&nbsp;&nbsp;</span> <input type="radio" name="searchDateType" value="i" checked="">
    </div>
</div>

I've tried changing the values when it isn't displayed, but that doesn't work. I need to find out how to trigger that event. Can someone point me in the right direction?


Thanks.

Share this post


Link to post
Share on other sites



Can you just use send and send the correct amount of tabs or down arrows to get to the desired end result?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

There's likely some Javascript code that you will need to execute in order for the div block to become visible. Can you provide the link to the website? If not, then you will need to examine the web page's underlying code to try to find the exact Javascript function to call.

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

  • Similar Content

    • mjolnirmarkiv
      By mjolnirmarkiv
      Hi!
      Does anyone have any idea why Test() returns 0, while Test2() returns 1?
      #include <IE.au3> MsgBox(0, "", Test() & " " & Test2()) Func Test() Local $oHTML = ObjCreate("HTMLFILE") $oHTML.body.innerHTML = FileRead("Test.html") Return IsObj($oHTML.getElementsByClassName("example")) EndFunc Func Test2() Local $oIE = _IEAttach("", "instance", 1) Return IsObj($oIE.document.getElementsByClassName("example")) EndFunc Sample Test.html I open in IE before testing:
      <!DOCTYPE html> <html> <body> <p class="example"></p> <div class="example"></div> </body> </html> I'm receiving html text in a response to http request, I need to parse it fast and easy, getElementsByClassName would have been ideal. I'm using 3.3.12.0 version.
    • ADIN
      By ADIN
      When at some page i access by  IE.au3 appears javascript alert all my code stops and i cant do nothing. Is there any way to stop executing javascript at this page or any way to force autoit to click "OK" when this alert appears?
       
      _IENavigate($oIE, "www.example.com") _IELoadWait($oIE) ; site is loaded and alert appears Send("{ENTER}") ;i want to close alert, this command is not executed, whole script is freeze ; cant do nothing more here....  
    • ADIN
      By ADIN
      I want use _IEFormGetCollection to get form content which was generated by javascript
      Local $oIE = _IECreate("https://www.example.com/login.html") ;Open the login page Local $oSpans = _IETagNameGetCollection($oIE, "span") For $oSpan In $oSpans if $oSpan.innertext == "Login" Then _IEAction($oSpan, "click") EndIf Next ;click span which ganerate by javascript login form Local $oForm = _IEFormGetCollection($oIE, 0) ;get my form, but that was not on website after loading, appears after click button and this function cant see it Local $oEmail = _IEFormElementGetObjByName($oForm, "email") ; trying to parse form but cant _IEFormElementSetValue($oEmail, "example@gmail.com") ; _IEFormGetCollection dont see generated dynamically elements Is here any way to _IETagNameGetCollection read website content again after i inititate a javascript which generate additional content?
    • dumbledown
      By dumbledown
      Hi,
      I'm new to AutoIt but it looks great.
      I want to get the text from Internet Explorer when hovering the mouse over an image, the statusbargettext function appears to be the way to go.
      When running via a hotkey I return a blank, but the msgbox works. Do you know what I'm doing wrong?
      Thanks
      HotKeySet("!x", "RecordURL") ;wait for ALT-a keystroke While 1 ;loop forever to wait for the keypress Sleep(100) ;no need to kill the CPU WEnd Func RecordURL() #include <MsgBoxConstants.au3> AutoItSetOption("WinTitleMatchMode", 2) Local $sText = StatusbarGetText("Internet Explorer") MsgBox($MB_SYSTEMMODAL, "", "Internet Explorer's status bar says: " & $sText) EndFunc