Sign in to follow this  
Followers 0
Voryn

How to submit a form when the submit element has no id or name?

11 posts in this topic

Hi there,

as mentioned in the topic im looking for a solution for the following problem:

I want to submit a form where the sumbit button hasn't an id or name.

Here's the HTML Code with the button i want to trigger:

<table cellspacing="0" cellpadding="0" border="0" class="class1">
<tr>
 <td class="submit" colspan="3"><input onfocus="func();" class="class2" type="button" value="send it!"></td>
</tr>
</table>

Any ideas? :P

Share this post


Link to post
Share on other sites



Yes.

What i missed to mention:

i can't trigger it via collection index because the form isn't static in it's elements so the index would change from time to time.

Share this post


Link to post
Share on other sites

Hi there,

as mentioned in the topic im looking for a solution for the following problem:

I want to submit a form where the sumbit button hasn't an id or name.

Here's the HTML Code with the button i want to trigger:

<table cellspacing="0" cellpadding="0" border="0" class="class1">
<tr>
 <td class="submit" colspan="3"><input onfocus="func();" class="class2" type="button" value="send it!"></td>
</tr>
</table>

Any ideas? :P

Use the IE.au3 UDF, get the collection of "input" tags, loop through the collection looking for .value = "send it!".

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Use the IE.au3 UDF, get the collection of "input" tags, loop through the collection looking for .value = "send it!".

:P

Mhm i'm allready using some functions of the IE UDF but i guess to crawl through the collection is a bit too advanced for my current AutoIt skills, could you spare a code example with me? :(

Share this post


Link to post
Share on other sites

Mhm i'm allready using some functions of the IE UDF but i guess to crawl through the collection is a bit too advanced for my current AutoIt skills, could you spare a code example with me? :P

Something like this:
#include <IE.au3>

$oIE = _IECreate("http://your.site.com")

; This may need more drilling down into the DOM...
$colInputs = _IETagNameGetCollection($oIE, "input")
$sMsg = ""
For $oInput In $colInputs
    $sMsg &= "Input type=" & $oInput.type & ", value=" & $oInput.value & @CRLF
    If String($oInput.value) = "send it!" Then MsgBox(64, "Found", "Found 'send it!' input...")
Next
MsgBox(0, "Input Tags", $sMsg)

:(


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Something like this:

#include <IE.au3>

$oIE = _IECreate("http://your.site.com")

; This may need more drilling down into the DOM...
$colInputs = _IETagNameGetCollection($oIE, "input")
$sMsg = ""
For $oInput In $colInputs
    $sMsg &= "Input type=" & $oInput.type & ", value=" & $oInput.value & @CRLF
    If String($oInput.value) = "send it!" Then MsgBox(64, "Found", "Found 'send it!' input...")
Next
MsgBox(0, "Input Tags", $sMsg)

:P

You're awesome mate :(

I'll check it out tomorrow.

Greetings from germany, voryn

Share this post


Link to post
Share on other sites

You're awesome mate :P

I'll check it out tomorrow.

Greetings from germany, voryn

Mhm i tried around with this a little now but i have no clue how to use this so i can actually trigger my result with _IEAction($whatever,"click")

Share this post


Link to post
Share on other sites

Mhm i tried around with this a little now but i have no clue how to use this so i can actually trigger my result with _IEAction($whatever,"click")

Like this:
#include <IE.au3>

$oIE = _IECreate("http://your.site.com")

; This may need more drilling down into the DOM...
$colInputs = _IETagNameGetCollection($oIE, "input")
$sMsg = ""
For $oInput In $colInputs
    If String($oInput.value) = "send it!" Then 
        _IEAction($oInput, "click")
        MsgBox(64, "Click", "Clicked on 'send it' input tag.", 5)
        ExitLoop
    EndIf
Next

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

It finally works, thanks for helping out a noob :P

Share this post


Link to post
Share on other sites

It finally works, thanks for helping out a noob :(

You're welcome. I'm not that far off noobiness myself. (Yes, that's a word.)

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0