Jump to content

Cannot fill out textarea on web page!


Recommended Posts

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 works

The error show in console is :Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

Link to comment
Share on other sites

Hi and Welcome :bye:

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

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

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

think that there isn't no need for it

he 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

$desciptAd

instead

$descriptAd

newer 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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...