BrianTheLibrarian

Submitting a form that requires an OnClick

3 posts in this topic

Hello I am trying to submit this form

<form name="nextPageForm" style="margin: 0px; padding: 0px;" action="template.php" method="post">
    <input name="navRow" type="hidden" value="3">
        <div onclick="document.forms.nextPageForm.submit()">
            <img alt="next page" src="./images/icons/button_right.png"><br>next page
         </div>
</form>

I tried searching through the div tags for the inner text, then trying to fire the onclick of the div but that didn't work. 

$tags = $oIE.document.GetElementsByTagName("div")
For $tag in $tags
   If $tag.innertext = "next page" Then
      $tag.fireEvent("onclick")
      _IEAction($tag, "click")
    EndIf
Next

Trying to just click on the image didn't work

_IEImgClick($oIE, "next page", "alt")

And just tried to submit the form.  No luck so far.  Any ideas or code examples would be greatly appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use StringStripWs with flag 7 around $tag.innertext  should work, as you have a @lf in the name i.e. <br>.

Edited by Subz
1 person likes this

Share this post


Link to post
Share on other sites

Thanks that worked!

$tags = $oIE.document.GetElementsByTagName("div")
For $tag in $tags
   $strip = StringStripWs($tag.innertext, 7)
   If $strip = "next page" Then
      $tag.fireEvent("onclick")
      _IEAction($tag, "click")
    EndIf
Next

 

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