Sign in to follow this  
Followers 0
redrum

Clicking Element in Form, No names available

4 posts in this topic

Hello all,

I've really been banging my head on this. Any help will be appreciated!

Form HTML:

<FORM method=post action=delete_portfolio.php><A href=""><IMG style="FLOAT: left; MARGIN-RIGHT: 10px" class=cancel_delete_btn alt=Cancel src="images/btn_cancel.gif" jQuery1262704277595="6"></A><INPUT id=portfolio_to_delete class=image type=hidden name=portfolio_to_delete><INPUT style="FLOAT: left" id=confirm_delete_btn alt=Delete src="images/btn_delete.gif" type=image jQuery1262704277595="7"></FORM>

I'm trying to click the "confirm_delete_btn" in this Form.

Name is hidden

I'm quite sure I've indexed the correct Form, there are no names on the Forms either, but I did a collection and displayed the Form information to confirm the index (starting with 0 as the index of the first form).

I'm not sure how to index the correct element in the form to get the "confirm_delete_button, but have tried different index numbers and always get the "InvalidDataType" error: IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType

I'm using these commands:

$oForm = _IEFormGetCollection ($oIE, 4)

$oDELbtn = _IEFormElementGetCollection ($oForm, 4)

_IEAction ($oDELbtn, "click")

NOTE: When I do a "delete" in this case, there is always only one Portfolio to delete, so was hoping that I only need to click on the delete button. There is also an INPUT, to which I may need to submit a "Portfolio name". Will deal with that after I solve this InvalidDataType error.

Hoping for some suggestions of direction here. Maybe there is a better way??

Regards

Doug

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Maybe this will work?

$oDELbtn = _IEGetObjById($oForm,"confirm_delete_btn")
Edited by Pantera975

Share this post


Link to post
Share on other sites

Good suggestion. I tried this and got a NoMatch error. Tried different index on the Form Collection (in case I was picking the wrong form) and still NoMatch for the ID.

It's interesting that I didn't get a NoMatch with the initial approach.\

Thanks

Share this post


Link to post
Share on other sites

$oDELbtn = _IEGetObjById($oIE, "confirm_delete_btn")


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