Jump to content
Sign in to follow this  

Submitting IE form with javascript submit button

Recommended Posts


Man oh man, i have tried absolutly everything i can think of to try and submit this form, but i have not suceeded...i have looked through countless forum posts and used dales debugbar, but have got nothing as to why it is not submitting.

Here is the html for the form i want to submit...

<form id="inviteForm" action="/process_invites">
                            <div class="inviteFieldBKG">
                                <div class="inviteField">
                                  <textarea id="emails" name="emails" rows="3" cols="10">Insert email addresses separated by commas</textarea>
                                <div class="inviteField" style="margin-top:8px;">

                                  <textarea id="message" name="message" rows="3" cols="10">Write a personal message to your friends HERE</textarea>
                            <div id="sendInvite" class="left">
                                <a onblur="document.getElementById('sendInviteSucces').style.display='none';" href="javascript:void(0);"><img src="http://static.lockerz.com/sites/default/themes/sky/assets/img/connect/btn-invite.png" alt="Invite Button" width="74" height="31" id="inviteBTN" onmouseover="MM_swapImage('inviteBTN','','http://static.lockerz.com/sites/default/themes/sky/assets/img/connect/btn-invite-over.png',1)" onmouseout="MM_swapImgRestore()" style="margin-left:7px; margin-top:7px; float:left;" /></a>
                                <img id="sendInviteSucces" style="display:none; margin-top: 7px;" src='http://static.lockerz.com/sites/default/themes/sky/assets/img/connect/msg-success.png' width='119' height='31' alt='Successfully Sent' />
                                <img id="iconerror" src="http://static.lockerz.com/sites/default/themes/sky/assets/img/connect/icon-Error.png" width="35" height="24" alt="Error" />
                                <div id="errorOuter">
                                    <div id="errorMiddle">

                                        <div id="errorInner"></div>

The html above contains two textboxes; "emails" and "message", of which i can fill in both easily with...

$oFormINVITE = _IEFormGetCollection($oIE, 0)
    $oElementINVITE = _IEFormElementGetCollection($oFormINVITE)
    $oElementEmailsINVITE = _IEFormElementGetObjByName($oElementINVITE, "emails")
    $oElementMessageINVITE = _IEFormElementGetObjByName($oElementINVITE, "message")

    _IEFormElementSetValue($oElementEmailsINVITE, $EmailAddress)
    _IEFormElementSetValue($oElementMessageINVITE, "Thanks!")

However, it comes to submitting and i have tried all these methods...


$oImageClick=_IEImgClick($oIE,"Invite Button","alt")


$oImageINVITE1=_IEGetObjById ($oIE, "inviteBTN")
$oImageClick=_IEAction ($oImageINVITE1, "click" )


None of which worked, i also tried ControlSend, after having a cheeky look at the help file under _IEAction(), but was unable to make that work...although i am pretty sure that is the way forward...if anyone has ANY ideas, i would be extremely grateful!!

Thanks in advance

Edited by furrycow

Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post

Link to post
Share on other sites

I'm having almost the exact same issue on a different site, any luck?

Share this post

Link to post
Share on other sites

Your invite image has an Id of "inviteBTN". Take a look for other Javascript on the page (typically in the HEAD section) that references it - most likely defining an onclick event.


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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