mathew Posted January 31, 2006 Share Posted January 31, 2006 hi, i have a problem with a form. the html code is like this: <html> <body> <form action="bla.php" method="post"> <input type="text" name="feld1" value=""> <input type="submit" name="action" value="test1"> <input type="text" name="feld2" value=""> <input type="submit" name="action" value="test2"> </form> </body> </html> the problem is that i cant change the html/php code of the site but i want to submit with test2. so i search a method to submit the 2. button. the version writing everything in the header doesnt work. (e.g. http://..../bla.php?feld2=5&action=test2) my autoit script is now at this point... $o_b_get=ObjCreate("InternetExplorer.Application") $o_b_get.visible=1 $o_b_get.navigate("http://..../bla.php") If LoadingDone($o_b_get) == "ERROR" Then Exit EndIf $o_b_get.document.forms(0).elements.item("feld2",0).value=1 $o_b_get.document.forms(0).elements.submit but this code submits with value "test1" can anybody help me how to submit with value "test2"? thx mathew Link to comment Share on other sites More sharing options...
flaxcrack Posted January 31, 2006 Share Posted January 31, 2006 hi, i have a problem with a form. the html code is like this: <html> <body> <form action="bla.php" method="post"> <input type="text" name="feld1" value=""> <input type="submit" name="action" value="test1"> <input type="text" name="feld2" value=""> <input type="submit" name="action" value="test2"> </form> </body> </html> the problem is that i cant change the html/php code of the site but i want to submit with test2. so i search a method to submit the 2. button. the version writing everything in the header doesnt work. (e.g. http://..../bla.php?feld2=5&action=test2) my autoit script is now at this point... $o_b_get=ObjCreate("InternetExplorer.Application") $o_b_get.visible=1 $o_b_get.navigate("http://..../bla.php") If LoadingDone($o_b_get) == "ERROR" Then Exit EndIf $o_b_get.document.forms(0).elements.item("feld2",0).value=1 $o_b_get.document.forms(0).elements.submit but this code submits with value "test1" can anybody help me how to submit with value "test2"? thx mathew Use IE.AU3 http://www.autoitscript.com/forum/index.php?showtopic=13398 [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
mathew Posted January 31, 2006 Author Share Posted January 31, 2006 i took my code from this libary but with this functions it doesnt work. thats because i asked in this forum.... Link to comment Share on other sites More sharing options...
flaxcrack Posted January 31, 2006 Share Posted January 31, 2006 i took my code from this libary but with this functions it doesnt work.thats because i asked in this forum.... Okay....But IE.AU3 will do what you are looking for. [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
mathew Posted January 31, 2006 Author Share Posted January 31, 2006 can you give me the ie.au3 functions which should submit the second button in the same form? i dont know how to use it. maybe i just dont see the way .... Link to comment Share on other sites More sharing options...
flaxcrack Posted January 31, 2006 Share Posted January 31, 2006 can you give me the ie.au3 functions which should submit the second button in the same form?i dont know how to use it. maybe i just dont see the way ....http://www.autoitscript.com/forum/index.php?showtopic=13398 [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
mathew Posted January 31, 2006 Author Share Posted January 31, 2006 well i can read... but the function _IEFormSubmit() does only support to submit a botton in a form. but not a specific button in a form when there are more than 1 button in a form! how should i use the libary to submit the second button? _IEFormSubmit( $object ) but the $object means the form. how can i tell the function to submit the 2. button? Link to comment Share on other sites More sharing options...
DaleHohm Posted February 1, 2006 Share Posted February 1, 2006 well i can read... but the function _IEFormSubmit() does only support to submit a botton in a form. but not a specific button in a form when there are more than 1 button in a form! how should i use the libary to submit the second button? _IEFormSubmit( $object ) but the $object means the form. how can i tell the function to submit the 2. button? You're right... _IEFormSubmit executes the default submit action for the form. You need to perform a .click method on the second button. This should point you in the right direction (after you fill in the '...'s). $oForm = _IEFormGetObjByName(...) $oButton2 = _IEFormElementGetObjByName(...) $oButton2.click Dale 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 Link to comment Share on other sites More sharing options...
mathew Posted February 1, 2006 Author Share Posted February 1, 2006 thx dale. that was what i was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now