How to use TAG to write content to an Editable DIV ?

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
anthonydesouza
Posts: 4
Joined: Mon Nov 07, 2011 12:28 pm
Location: Croydon, England

How to use TAG to write content to an Editable DIV ?

Post by anthonydesouza » Mon Nov 07, 2011 12:39 pm

Hi,

I have started evaluating iMacro with our ajax web application but have come across an issue with content-editable DIV's.
We use these to implement a text editor type control - much like the box I am typing in now actually.

Is there any way possible for iMacros for Firefox to write content directly to a contenteditable DIV?

I have tried the following syntax which does not error but also does not write "hello world" in my editable div.

TAG POS=1 TYPE=DIV ATTR=ID:iEditorComment_* CONTENT=hello<sp>world

As an added complication (perhaps) we generate our web pages dynamically (hence the use of a wild card in the ID in the above example.

Many thanks,
Anthony
anthonydesouza
Posts: 4
Joined: Mon Nov 07, 2011 12:28 pm
Location: Croydon, England

Re: How to use TAG to write content to an Editable DIV ?

Post by anthonydesouza » Thu Nov 10, 2011 6:10 pm

Ok, a few days later and with a better understanding of iMacros I solved my original problem.

Code: Select all

In javascript I created a function to write to my content editable div:

function writeEditableDiv(div_id, strHTML)
{
	document.getElementById(div_id).innerHTML = strHTML;
}

in my imacros script I call this function like this:

URL GOTO=javascript:writeEditableDiv("my_editor_div","Hello<SP>World!") 
It is not as simple as just using TAG but still very flexible.
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: How to use TAG to write content to an Editable DIV ?

Post by Daniel, Tech Support » Thu Nov 10, 2011 9:38 pm

Hi,

I'm very sorry for the delayed response, but its great you've found the solution yourself! Good job!

Best regards,
Daniel, iOpus Support
vertigo235
Posts: 1
Joined: Mon Feb 20, 2012 11:33 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by vertigo235 » Mon Feb 20, 2012 11:36 pm

I need to do this, and I do not have the ability to edit the source code as you do.

Is there any other way to input text into an editable div, is it possible to input text into an absolute position?
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: How to use TAG to write content to an Editable DIV ?

Post by Daniel, Tech Support » Tue Feb 21, 2012 1:06 pm

vertigo235 wrote:Is there any other way to input text into an editable div, is it possible to input text into an absolute position?
Definitely, but only in commercial version of iMacros Browser: http://wiki.imacros.net/DS
vertigo235 wrote:I need to do this, and I do not have the ability to edit the source code as you do.
Well, tell me what you need to automate, may be I can do it for you.

Best,
Daniel, iOpus Support
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: How to use TAG to write content to an Editable DIV ?

Post by Daniel, Tech Support » Tue Feb 21, 2012 1:08 pm

P.S. You could also try http://wiki.imacros.net/CLICK, but I'm not sure it will work in this situation.
Daniel, iOpus Support
mevsme
Posts: 14
Joined: Fri Sep 20, 2013 3:00 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by mevsme » Fri Sep 20, 2013 3:12 pm

I need to place data in editable DIV to enter message, could you tell me how to do that?
The site is vk.com, there is a lot of ajax there, so you even could try automate some other things, 80% I tried - doesn't work at all for me :? .
mevsme
Posts: 14
Joined: Fri Sep 20, 2013 3:00 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by mevsme » Tue Sep 24, 2013 2:12 pm

I have made a video: youtube video

In this case recording didn't work, but i've found out how to get what I want: i'm using experimental mode, and words are placed in div by tag `CHARS="some words"

But am I doing something wrong in `automatic select record mode`?

Why there's no any wiki-article about CHARS?
chivracq
Posts: 9494
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to use TAG to write content to an Editable DIV ?

Post by chivracq » Thu Sep 26, 2013 1:02 am

mevsme wrote:I have made a video: youtube video

In this case recording didn't work, but i've found out how to get what I want: i'm using experimental mode, and words are placed in div by tag `CHARS="some words"

But am I doing something wrong in `automatic select record mode`?

Why there's no any wiki-article about CHARS?
These Issues have already been reported in that following Thread of mine:
'Feedback and Issues on EVENT Recording Mode.'
You may want to add there some additional info and to give it more "weight" to bump it...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Tom, Tech Support
Posts: 3613
Joined: Mon May 31, 2010 4:59 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by Tom, Tech Support » Fri Sep 27, 2013 11:12 am

Typically, the quickest/easiest workaround for these cases is to use the DirectScreen mode available in the iMacros Standard and Enterprise Editions.

I can't say at this point how long it will take the development team to address this issue in iMacros for Firefox, or even *if* it will be addressed.
Regards,

Tom, iMacros Support
buxtic
Posts: 13
Joined: Tue Jun 14, 2016 1:34 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by buxtic » Fri Jan 06, 2017 11:14 am

I need help
How can I write in div?
help please!

TAG POS=1 TYPE=div ATTR=ID:posting_form_text_field

<div id="posting_form_text_field" class="itx itx__ce ok-e textWrap js-focus" contenteditable="true">textexemple...</div>
Tom, Tech Support
Posts: 3613
Joined: Mon May 31, 2010 4:59 pm

Re: How to use TAG to write content to an Editable DIV ?

Post by Tom, Tech Support » Fri Jan 27, 2017 1:56 pm

buxtic wrote:I need help
How can I write in div?
help please!

TAG POS=1 TYPE=div ATTR=ID:posting_form_text_field

<div id="posting_form_text_field" class="itx itx__ce ok-e textWrap js-focus" contenteditable="true">textexemple...</div>
Hi buxtic,

Have you tried using the EVENT recording mode?
Regards,

Tom, iMacros Support
Post Reply