Jump to content
lark20020812

ask for help for click input type = hidden

Recommended Posts

html code below,

<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
<FORM onsubmit="return false;" name=exportform>
<INPUT value=false type=hidden name=fieldsyn>
<INPUT value=false type=hidden name=notesyn>
<INPUT value=false type=hidden name=statusyn>
<INPUT type=hidden name=statusmonth>
<INPUT type=hidden name=statusyear>
<INPUT value=false type=hidden name=exportyn>
<INPUT value=false type=hidden name=lettersyn>
<INPUT value=false type=hidden name=regionsyn>
<INPUT value=false type=hidden name=tu_exportyn>
<INPUT value=false type=hidden name=score_exportyn> </FORM>

I need to click the box name=exportyn

 

My code as below,

Local $oInputs = _IETagNameGetCollection($oForm, "input")
 For $oInput In $oInputs
    IF $oInput.value = True and String($oInput.NAME) = "exportyn" THEN
       ConsoleWrite($oInput.name)
    _IEFormElementCheckBoxSelect($oInputs, "", "exportyn", 1, "byValue")
    ExitLoop
    EndIf
 Next

no luck, also tried

$oeles = _IEFormElementGetCollection($oform)
For $oele In $oeles
if $oele.name = "exportyn" and $oele.value="false" then _IEFormElementSetValue($oele, "True",1)
ConsoleWrite(@TAB & 'Name: ' & $oele.name & '   Tag Type: ' & $oele.tagName & '    Value: ' & $oele.value & '   Type: ' & $oele.type &@CRLF)

_IEAction($oele.name, "click")
Next

still no luck

but console gave me:

"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "N:MY AUTOITtest1.au3"    
    Name: fieldsyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: notesyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: statusyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: statusmonth   Tag Type: INPUT    Value:    Type: hidden   ID:
    Name: statusyear   Tag Type: INPUT    Value:    Type: hidden   ID:
    Name: exportyn   Tag Type: INPUT    Value: True   Type: hidden   ID:
    Name: lettersyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: regionsyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: tu_exportyn   Tag Type: INPUT    Value: false   Type: hidden   ID:
    Name: score_exportyn   Tag Type: INPUT    Value: false   Type: hidden   ID:

Share this post


Link to post
Share on other sites

Those input are all checkbox,  I  wanna click one of those checkbox with name "exportyn“,  _IEFormElementCheckBoxSelect failed.

I could use  _IEFormElementSetValue to set value from falue to true. 

Share this post


Link to post
Share on other sites

BTW:

Would you please be so kind and use AutoIt code tags when posting code?

That is the blue "A" button in the editor. Makes the code much more readable :)

Details can be found >here.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-07-31 - Version 1.4.12.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi,

I tries _IEACTION and _IEFormElementCheckBoxSelect, no luck

$L_o_Inputs = _IETagNameGetCollection($oForm, "INPUT")
    $L_iInputCnt = @extended
    ConsoleWrite("Found " & $L_iInputCnt & " input tags" & @LF)
    Local $flagRFC = 0
    If $L_iInputCnt Then
        For $L_oInput In $L_o_Inputs
            If $L_oInput.name = "exportyn" Then
                ConsoleWrite("Found exportyn" & @LF)
                _IEAction($L_oInput, "click")
;~              _IEFormElementCheckBoxSelect($L_oInput, "exportyn", "", 1, "byValue")
            EndIf
        Next
    EndIf

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...