Jump to content

IE submit javascript form by input button


Recommended Posts

I would like to press the continue button on our administration page 

button code, the form "id" and name are randomly generated

 

<form action="/administration/" method="post" name="2428" id="2428" onsubmit="solveJScap(); get('/administration/', '', this); disableSubmitButton(this); return false;">

<input class="button-maroon button-small" type="submit" value=" Continue "></p></form>

 

ive tried this code, it works for other buttons but not this one

Func clickobjbyclass(ByRef $oIE, $class)
    $tags = $oIE.document.GetElementsByTagName('input')
    For $tag In $tags
        $class = $tag.GetAttribute('class')
        If String($class) = $class Then
            Return _IEAction($tag, 'click')
        EndIf
    Next
    Return False
EndFunc

A spacebar and enter key controlclick also don't function

furthermore ive tried 

_IEFormSubmit($oForm)

but this also doesn't seem to trigger the continue button 

 

 

please help me out :- )

Link to comment
Share on other sites

Not sure how your function would ever return anything outside of a false positive...try this instead

Func clickobjbyclass(ByRef $oIE, $sCallersClass)
    Local $tags = $oIE.document.GetElementsByTagName('input')
    For $tag In $tags
        Local $class = $tag.className()
        If String($class) = String($sCallersClass) Then
            Return _IEAction($tag, 'click')
        EndIf
    Next
    Return False
EndFunc

notice I'm NOT overwritting the variable being passed in.

 

Also, check out the rules and etiquette of the forum before doing more 'bumps'

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

15 hours ago, jdelaney said:

Not sure how your function would ever return anything outside of a false positive...try this instead

Func clickobjbyclass(ByRef $oIE, $sCallersClass)
    Local $tags = $oIE.document.GetElementsByTagName('input')
    For $tag In $tags
        Local $class = $tag.className()
        If String($class) = String($sCallersClass) Then
            Return _IEAction($tag, 'click')
        EndIf
    Next
    Return False
EndFunc

notice I'm NOT overwritting the variable being passed in.

 

Also, check out the rules and etiquette of the forum before doing more 'bumps'

that still doesn't click the input button in question

Link to comment
Share on other sites

  • Moderators
On 6/27/2018 at 5:25 PM, PajeetLjama said:

bump

 

On 6/27/2018 at 6:23 PM, PajeetLjama said:

bumperino

In the future, please do not bump your posts without waiting at least 24 hours. This may be the most important thing in the world to you, but you need to show some patience. Additionally, you could use that 24 hours to actually try new ways of solving the issue yourself, rather than simply waiting for someone to hand you code and then replying "it didn't work".

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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