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

    • Gowrisankar
      By Gowrisankar
      Hello everyone,
      When I launch a URL and the webpage takes more time to load (say more than 1 minute), I want the URL to be relaunched.
      I used _IELoadWait(). But the control doesn't get pass through the _IELoadWait() command, since the webpage takes more time to load.
      I searched some of the older posts related to this topic. But I couldn't work them out.
      Please guide me.
    • Jefrey
      By Jefrey
      I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads.
      Three functions are available:
      string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available:
      URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md
      Fork me on Github: https://github.com/jesobreira/HTTP.au3
      Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip
    • elbhiri
      By elbhiri
      i have two files a.au3 and b.au3 the both contains the same code which is :
      #include <IE.au3> #include <MsgBoxConstants.au3> Global $myUrl = "https://www.autoitscript.com" RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging','REG_DWORD','00000000') ShellExecute ("iexplore.exe", " -nosessionmerging about:blank") WinWait ("Blank Page") Global $oIE = _IEAttach ("about:blank", "url") _IELoadWait ($oIE) _IENavigate ($oIE, $myUrl) when i launch the both files in the same time two blank windows are opens.
      what im waiting for is that every window navigate to the link but what happen is the first and the second file navigate the url to the same window and the seconde window stay about:blank
      i think the problem happen because i try to open the same url in both windows
      so i need i way to navigate to the same url from two different windows
      Thanks in advance
    • HudsonKane
      By HudsonKane
      I have a page with several hundred <div>s, and each <div> has several hundred child <div>s, each with their own children
      when I use _IETagNameGetCollection($ie, "div", 0) I get them all, but I need to find a way to get say the 3rd child of the 5th child of the second top level <div>
      I have not yet been able to find anything along this line
      Is there any way to determine if an element is a child, parent, sibling?
      Thank you
    • 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.