Jump to content
Sign in to follow this  
PajeetLjama

IE submit javascript form by input button

Recommended Posts

PajeetLjama

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 :- )

Share this post


Link to post
Share on other sites
PajeetLjama

bump

Share this post


Link to post
Share on other sites
PajeetLjama

bumperino

Share this post


Link to post
Share on other sites
jdelaney
Posted (edited)

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.

Share this post


Link to post
Share on other sites
PajeetLjama
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

Share this post


Link to post
Share on other sites
Danp2
43 minutes ago, PajeetLjama said:

that still doesn't click the input button in question

Doesn't click it (because it wasn't found) or just doesn't trigger an underlying event? There is a difference. ;)

Share this post


Link to post
Share on other sites
PajeetLjama
7 minutes ago, Danp2 said:

Doesn't click it (because it wasn't found) or just doesn't trigger an underlying event? There is a difference. ;)

it doesn't triggered an underlying event

Share this post


Link to post
Share on other sites
PajeetLjama
1 minute ago, Danp2 said:

Probably could do it with jQuerify but difficult to provide further help without access to the site.

you can see the code the form uses in the post

Share this post


Link to post
Share on other sites
Danp2

@PajeetLjama Yes, I know. However, I often solve these types of issues via trial and error, where I keep at it until I find a solution. Since only you have access to the site, that limits you to perform the testing to identify a working solution.

Share this post


Link to post
Share on other sites
Juvigy

Have you tried to execute the java code directly?

"solveJScap(); get('/administration/', '', this); disableSubmitButton(this); return false;">

Share this post


Link to post
Share on other sites
JLogan3o13
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".


√-1 2^3 ∑ π, and it was delicious!

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
Sign in to follow this  

×