How to enter values in the textarea from CSV

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
JagadeeshK
Posts: 8
Joined: Tue Jan 05, 2016 3:41 pm

How to enter values in the textarea from CSV

Post by JagadeeshK » Fri Jan 22, 2016 8:57 am

Hi,

I'm using iMacros V11 in FF 43.0.2. I'm using javascript for doing some validations. I'm trying to enter (input) values in the text area field.

I used the hardcoded value like below, and it worked without any issues.

Code: Select all

iimPlay("CODE:TAG POS=1 TYPE=TEXTAREA FORM=ID:updateproducts ATTR=ID:gift-message-*-message CONTENT=Test<SP>Text<SP>test");
So, for the same field, I want to get the(input) data from the csv file, and I tried the below code

Code: Select all

iimPlay("CODE:TAG POS=1 TYPE=TEXTAREA FORM=ID:updateproducts ATTR=ID:gift-message-*-message CONTENT="+spl[11]);
trying to enter data from the 11th column .The above mentioned code is not working, it's not entering the data into the textarea field.

Code: Select all

iimDisplay (spl[11]);
-- This displays the value in the 11th column without any issues.

if the 11th column is having only a single string (for example "test"), this code

Code: Select all

iimPlay("CODE:TAG POS=1 TYPE=TEXTAREA FORM=ID:updateproducts ATTR=ID:gift-message-*-message CONTENT="+spl[11]);
is working perfectly. But when the 11th column contains a value like "test test", the above code is not working. Which means that it's not accepting the words, that has spaces in between. Please help me on resolving this, also plz let me know if you need more details

Thanks,
Jagadeesh.K
JagadeeshK
Posts: 8
Joined: Tue Jan 05, 2016 3:41 pm

Re: How to enter values in the textarea from CSV

Post by JagadeeshK » Fri Jan 22, 2016 1:42 pm

I found a way to make it work. Just need to replace all the blank spaces with the <SP>tag.

Code: Select all

var tmpstr = spl[11].replace(/ /g,'<SP>');
iimPlay("CODE:TAG POS=1 TYPE=TEXTAREA FORM=ID:updateproducts ATTR=ID:gift-message-*-message CONTENT="+tmpstr);
If someone know a better/simple way to fix this, plz share that.

Thanks,
Jagadeesh.K
Post Reply