superbosu Posted February 23, 2011 Share Posted February 23, 2011 (edited) Hi all, I have some problems filling with text a TEXTAREA on a webpage. I attached the html file, maybe somebody can help me. I tried with this code but nothing happens: $oForm = _IEFormGetObjByName ($oIE, "TEXTAREA") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, "bla bla bla bla") I have to fill the "Comment" area please help! test.html Edited February 23, 2011 by superbosu Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 23, 2011 Share Posted February 23, 2011 Not much to go on for symptoms. Add _IEErrorHandlerRegister() near the top of your script and run it in SciTE to see the messages in the console pane. Is there really a form by that name in your html? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
superbosu Posted February 23, 2011 Author Share Posted February 23, 2011 Not much to go on for symptoms. Add _IEErrorHandlerRegister() near the top of your script and run it in SciTE to see the messages in the console pane. Is there really a form by that name in your html? Hi PsaltyDS and tnx for the reply.. i'm new with autoit there is no form with that name in my html but there is a textarea with a the ID sys_tasklog is there a way to fill the text area using the id? this is the html code of the textarea: <td align="left" valign="top" width="139" class="tabline1" colspan="1">Comment</td><td align="left" valign="top" width="0" class="tabline1" colspan="3"><TEXTAREA id="sys_tasklog" NAME="sys_tasklog" ROWS="4" COLS="130" ></TEXTAREA><script LANGUAGE="Javascript" TYPE="text/javascript"> var input_ITALY_HD_CALL_EDIT_sys_tasklog = new rtcCreateInput( document.ITALY_HD_CALL_EDIT.sys_tasklog, RTC_TEXT_INPUT, true ); ITALY_HD_CALL_EDIT_Inputs[ ITALY_HD_CALL_EDIT_Inputs.length ] = input_ITALY_HD_CALL_EDIT_sys_tasklog; </SCRIPT></td> what is the correct way to fill the text area? maybe using $oForm = _IEGetObjById($oIE, "sys_tasklog") ? Link to comment Share on other sites More sharing options...
superbosu Posted February 23, 2011 Author Share Posted February 23, 2011 I tried also this code but didn't work $oSubmit = _IEGetObjById ($oIE, "sys_tasklog") _IEAction ($oSubmit, "focus") Send("D:\file.txt") I really don't know how to fill this imput textarea... help! Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 23, 2011 Share Posted February 23, 2011 Look for the FORM tag, and use the correct name of the form with _IEFormGetObjByName($oIE, "Your_Form_Name_Here") to get $oForm. Then the rest should work: #include <IE.au3> _IEErrorHandlerRegister() $sURL = "http://your.url.here" $oIE = _IECreate($sURL) ; ... $oForm = _IEFormGetObjByName ($oIE, "Your_Form_Name_Here") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, "bla bla bla bla") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
shai Posted February 23, 2011 Share Posted February 23, 2011 use _WinHttpSimpleFormFill function Link to comment Share on other sites More sharing options...
superbosu Posted February 23, 2011 Author Share Posted February 23, 2011 (edited) HI Shi, I don't find this function on help http://www.autoitscript.com/autoit3/docs/libfunctions.htm how can I use this on my example? for PsaltyDS ... I tried the code but nothing happens.... this is the form name : <FORM action="genericcall.asp" METHOD="POST" NAME="ITALY_HD_CALL_EDIT"> $oForm = _IEFormGetObjByName ($oIE, "ITALY_HD_CALL_EDIT") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, "bla bla bla bla") _IEFormElementSetValue ($oText, "bla bla bla bla") plese do a test with the file attached Edited February 23, 2011 by superbosu Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 23, 2011 Share Posted February 23, 2011 for PsaltyDS ... I tried the code but nothing happens.... this is the form name : <FORM action="genericcall.asp" METHOD="POST" NAME="ITALY_HD_CALL_EDIT"> $oForm = _IEFormGetObjByName ($oIE, "ITALY_HD_CALL_EDIT") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, "bla bla bla bla") _IEFormElementSetValue ($oText, "bla bla bla bla")You STILL haven't tried it with the error handler and reported the very explicit, helpful, and detailed errors it reported... plese do a test with the file attachedNot jolly likely. I don't know you. But you can do a test with the error handler, as I said earlier, and post the errors you get in the console pane of SciTE. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
shai Posted February 24, 2011 Share Posted February 24, 2011 HI Shi, I don't find this function on help http://www.autoitscript.com/autoit3/docs/libfunctions.htm how can I use this on my example? for PsaltyDS ... I tried the code but nothing happens.... this is the form name : <FORM action="genericcall.asp" METHOD="POST" NAME="ITALY_HD_CALL_EDIT"> $oForm = _IEFormGetObjByName ($oIE, "ITALY_HD_CALL_EDIT") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, "bla bla bla bla") _IEFormElementSetValue ($oText, "bla bla bla bla") plese do a test with the file attached Link to comment Share on other sites More sharing options...
superbosu Posted February 24, 2011 Author Share Posted February 24, 2011 Hi PsaltyDS, I don't know how to use _IEErrorHandlerRegister() and see the errors. but I did many tests and finaly it works in that way: $chiusura = FileRead("D:\repe\chiusura.txt") $oForm = _IEFormGetObjByName ($oIE, "ITALY_HD_CALL_EDIT") $oText = _IEFormElementGetObjByName ($oForm, "sys_tasklog") _IEFormElementSetValue ($oText, $chiusura) _IEFormSubmit ($oForm) _IEAction ($oIE, "back") _IELoadWait ($oIE) $oForm = _IEFormGetObjByName ($oIE, "ITALY_HD_CALL_EDIT") $oSubmit = _IEGetObjByName ($oIE, "whocares") _IEAction ($oSubmit, "click") so when i use _IEFormSubmit ($oForm) and go back with _IEAction ($oIE, "back") on the TEXTAREA I can see the txt donno why but it works... 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