Jump to content

Get input type


Recommended Posts

Writing a script which should allow autocompletion in any textfield, I was wondering if there is a way to get the type of any selected input field such as in a webbrowser to prevent suggestions in a password input box.

Thanks for your help

Edited by HcDevel
Link to comment
Share on other sites

Probably a better way, but this works for my window login

#include <GuiEdit.au3>
If Not _GUICtrlEdit_GetPasswordChar($hControl) Then
    ; This edit is not a password edit...do your autofill here
EndIf

conversely

#include <GuiEdit.au3>
If _GUICtrlEdit_GetPasswordChar($hControl) Then
    ; This edit is a password edit...do not do your autofill here
EndIf





oops, for a web broswer, the input generally will have an attribute:

type="password"

So if it has that attribute/value, then skip your functionality

$oIE = _IEAttach("Your title")
$oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
    If $oInput.type = "password" Then
        ConsoleWrite("IS a password input: " &  $oInput.outerhtml & @CRLF)
    Else
        ConsoleWrite("NOT a password input: " &  $oInput.outerhtml & @CRLF)
    EndIf
Next
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

  • 3 weeks later...

Thanks for the answers. But this isn't what I was looking for. I don't want to use an Internet Explorer window. The user should be able to use his prefered webbrowser and the detection should also work in other applications. So my problem is how to get gui elements of other, external applications.

It also would be a better way to recognize a textfield which was selected to be able to enable / disable the auto completition.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...