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

    • SkysLastChance
      By SkysLastChance
      I am not sure on how to grab the innertext I want. Is there a way I can just grab the second line, or is there a better way to do it all together? 
      #include <IE.au3> $oIE = _IEAttach("Form Details") $oDiv = _IEGetObjById($oIE, "Col3") ;Phone MsgBox (0,"Oops",$oDiv.outertext) When I use this code I get

       


       
      html.au3
    • anthonyjr2
      By anthonyjr2
      I have come across a weird issue that I am not sure how to solve. For some reason, whenever I call WinActivate in certain scenarios instead of opening the single window that already exists, it will create a new blank tab. It should be able to be recreated with this:
      AutoItSetOption("WinTitleMatchMode", 2) Sleep(1000) For $i=0 To 10 WinActivate("Internet Explorer") Next I am not actually doing this in my code, it is just to demonstrate the fact that new tabs keep popping up. Does anyone know why this happens?
       
      EDIT: So I am not sure how reproducible this is, because it only happens every once in a while for me. I will update with more info if I find out anything.
    • SkysLastChance
      By SkysLastChance
      #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("website") Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms MsgBox($MB_SYSTEMMODAL, "Form Info", $oForm.name) _IEImgClick($oForm.name, "Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=12.0.5522.0&amp;Name=Microsoft.ReportingServices.Rendering.HtmlRenderer.RendererResources.TogglePlus.gif", "src") Next I am having trouble clicking an image. Here is what I have tried. 

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning guys
      I was trying to not open another post, writing here my little issue, but seems that no one cares about, and so, I'm opening another post
      What I'm trying to do, is detect the event close sent from the virtual keyboard.
      Why?
      Because, I have an application which, when I set the focus on a textbox, if the virtual keyboard does not exist, then it is created, else, it's not created
      But, everytime I try to close the virtual keyboard, the focus remains on the textbox, and another $EN_FOCUS event it's launched and detected from my WM_COMMAND, and so, the virtual keyboard is opened again. 
      How can I solve this little "issue"? 
      I was trying to detect the event sent from the virtual keyboard, storing the handle of it in a variable, and setting:
      GUISetOnEvent($GUI_EVENT_CLOSE, "CloseVK", $hVirtualKeyboard) without any result.
      Can someone please help me?
      Thanks  
      EDIT:
      Here I'd like to see @Melba23, @water, @Danyfirex...