Sign in to follow this  
Followers 0
nofile

One form includ two <input> botton with the same "name" or "id",how to click one button?

7 posts in this topic

#1 ·  Posted (edited)

first of all, i am sorry for my poor english

my question is:

One form includ two <input> bottons with the same "name" or "id",but how to click one button?

i try to use

$oSubmit = _IEFrameGetObjByName($oFrameRightin, "send")

_IEAction($oSubmit,"click")

or

$colInputs = _IETagNameGetCollection($oFrameRightin, "input")

For $oSubmit in $colInputs

If String($oSubmit.value) = "send" Then

_IEAction($oSubmit, "click")

EndIf

Next

but failed,i hope somebody can help me,thank you very much

Edited by nofile

Share this post


Link to post
Share on other sites



who can help me?i am wating all the time, thank you very much

Share this post


Link to post
Share on other sites

Post the html code for the 2 buttons.Which one do you want to click - the first one or the second one?

Share this post


Link to post
Share on other sites

Post the html code for the 2 buttons.Which one do you want to click - the first one or the second one?

Thanks for your response,clik any one of them is ok.the form contains two <div> with the same code:

<div class="setToolbar setToolbarBtm">

<input type="button" onclick="sendsmt('send.y');" onmouseout="this.className='Btn BtnPos ImgBtn'" onmouseover="this.className='Btn BtnHV ImgBtn'" value="send" class="Btn BtnPos ImgBtn" name="send"><input type="button" onclick="SetFavOrg();sendsmt('save');" onmouseout="this.className='Btn BtnPos'" onmouseover="this.className='Btn BtnHV'" value="save" class="Btn BtnPos" name="savetodraft"><input type="button" onclick="sendsmt('sendaddr')" onmouseout="this.className='Btn BtnPos'" onmouseover="this.className='Btn BtnHV'" value="adress" class="Btn BtnPos" name="sendaddr"><input type="button" onclick="document.location='/coremail/fcg/ldapapp?funcid=foldmain&amp;sid=PAmTPRFyhSRAyAWw'" onmouseout="this.className='Btn BtnPos'" onmouseover="this.className='Btn BtnHV'" value="cancel" class="Btn BtnPos"><img width="1" height="1" src="http://tom.allyes.com/main/adfshow?user=Tom.com|mms|mms_5&amp;db=tom">

</div>

Share this post


Link to post
Share on other sites

the botton i wanted to click is:

<input type="button" onclick="sendsmt('send.y');" onmouseout="this.className='Btn BtnPos ImgBtn'" onmouseover="this.className='Btn BtnHV ImgBtn'" value="send" class="Btn BtnPos ImgBtn" name="send">

Share this post


Link to post
Share on other sites

Try :

$oIE = _IEAttach($link, "url")
    $oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input")

    For $element In $oArray
        If $element.name = "Send"  And $element.value = "Send"  Then 
                   _IEAction($element, "click")
                   Exitloop
                Endif
    Next

Share this post


Link to post
Share on other sites

Try :

$oIE = _IEAttach($link, "url")
    $oDoc = _IEDocGetObj($oIE)
    $oArray = $oDoc.getElementsByTagName ("input")

    For $element In $oArray
        If $element.name = "Send"  And $element.value = "Send"  Then 
                   _IEAction($element, "click")
                   Exitloop
                Endif
    Next

is ok!thanks

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