hoahieusuong Posted July 28, 2012 Share Posted July 28, 2012 Hi all!I am a newbie in autoit and i am not good at English. I have a problem with filling out a text into textarea. this is code of the textare:<label>Description<span class="mandatory"> *</span></label><textarea name="description" cols="80" rows="12" id="description" ></textarea><script type="text/javascript">//<![CDATA[$(document).ready(function() {$(document).ready(function () {var myNicEditor = new nicEditor({iconsPath : 'libs/nicEdit/nicEditorIcons.gif', buttonList : ['bold','italic','underline', 'left', 'center','right', 'justify', 'ul', 'ol', 'indent', 'outdent', 'forecolor', 'bgcolor', 'hr','link','unlink', 'fontSize', 'fontFormat'], countTextLeft: 0, count_input: 'count'}).panelInstance('description');});});//]]></script>I used the commands : "_IEFormElementGetObjByName" to get textarea object and "_IEFormElementSetValue" to set value to this object but not worksThe error show in console is :Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType Link to comment Share on other sites More sharing options...
MrMitchell Posted July 28, 2012 Share Posted July 28, 2012 Hi and Welcome Can you please post your actual AutoIt code? Be sure you wrap it in code tags, it's the "<>" icon in the toolbar. Link to comment Share on other sites More sharing options...
hoahieusuong Posted July 28, 2012 Author Share Posted July 28, 2012 Hi and Welcome Can you please post your actual AutoIt code? Be sure you wrap it in code tags, it's the "<>" icon in the toolbar. Thanks, mrMichell! This is my code: $oForm = _IEFormGetObjByName($oIE,"newad") $textarea = _IEFormElementGetObjByName($oForm, "descripstion") _IEFormElementSetValue($textarea, "test test") If tag textarea without script about nicEditor, my code works well! Link to comment Share on other sites More sharing options...
MrMitchell Posted July 28, 2012 Share Posted July 28, 2012 "descripstion" needs to be "description" ... don't really see anything else right now Link to comment Share on other sites More sharing options...
hoahieusuong Posted July 29, 2012 Author Share Posted July 29, 2012 This is full code of the web page<link rel="stylesheet" href="http://www.classifiedsgiant.com/libs/jQuery/plugins/fancybox/jquery.fancybox-1.3.4.min.css" type="text/css" media="screen" /><form name="newad" method="post" enctype="multipart/form-data" action="newad.php?step=3"> <div class="form_content"> <input type="hidden" name="category" value="254"/> <input type="hidden" name="package" value="1"/> <input type="hidden" name="usr_pkg" value="16023124"/> <h2>Ad Description</h2> <!-- TITLE --> <label>Title<span class="mandatory"> *</span></label> <input type="text" name="title" id="title" size="60" value="" onkeydown="CountTitleLeft(document.newad.title,150);" onkeyup="CountTitleLeft(document.newad.title,150);" onpaste="CountTitleLeft(document.newad.title, 150);"/> <!-- DESCRIPTION --> <label>Description<span class="mandatory"> *</span></label> <textarea name="description" cols="80" rows="12" id="description" ></textarea> <h2>Ad Information</h2> <script type="text/javascript"> //<![CDATA[ $(document).ready(function() { $(document).ready(function () { var myNicEditor = new nicEditor({iconsPath : 'libs/nicEdit/nicEditorIcons.gif', buttonList : ['bold','italic','underline', 'left', 'center', 'right', 'justify', 'ul', 'ol', 'indent', 'outdent', 'forecolor', 'bgcolor', 'hr','link','unlink', 'fontSize', 'fontFormat'], countTextLeft: 0, count_input: 'count'}).panelInstance('description'); }); }); //]]> </script>And this is my code autoit$logForm = _IEFormGetObjByName($oIE,"newad") $titleAd = _IEFormElementGetObjByName($logForm, "title") $desciptAd = _IEFormElementGetObjByName($logForm,"description") _IEFormElementSetValue($titleAd,"this is title") _IEFormElementSetValue($descriptAd, "this is description")And the error from console is: Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType Thanks! Link to comment Share on other sites More sharing options...
Juvigy Posted July 30, 2012 Share Posted July 30, 2012 On which one do you get the error - _IEFormElementSetValue($titleAd,"this is title") or _IEFormElementSetValue($descriptAd, "this is description") ? Link to comment Share on other sites More sharing options...
hoahieusuong Posted July 30, 2012 Author Share Posted July 30, 2012 On which one do you get the error - _IEFormElementSetValue($titleAd,"this is title") or _IEFormElementSetValue($descriptAd, "this is description") ?Thanks Juvigy!the error at this function : _IEFormElementSetValue($descriptAd, "this is description") Link to comment Share on other sites More sharing options...
Juvigy Posted July 31, 2012 Share Posted July 31, 2012 Could you please replace it with : ConsoleWrite($desciptAd.id&".............."&$desciptAd.Innerhtml&@CRLF) And post what you get in the console from it. Link to comment Share on other sites More sharing options...
bogQ Posted July 31, 2012 Share Posted July 31, 2012 (edited) think that there isn't no need for ithe corrected his problem probably and told you 'Thanks Juvigy!' newer the less if he did not corrected it solution is to change variable to correct variable name$desciptAdinstead$descriptAdnewer the less this works just fine for me#include <IE.au3> $oIE = _IECreate('somefile.html') $oForm = _IEFormGetObjByName($oIE,"newad") $titleAd = _IEFormElementGetObjByName($oForm, "title") $desciptAd = _IEFormElementGetObjByName($oForm,"description") _IEFormElementSetValue($titleAd,"this is title") _IEFormElementSetValue($desciptAd, "this is description") Edited July 31, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. 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