Set value to nicedit - which uses textarea as an instance
Asked Answered
J

2

6

Here is the link, your webbrowser will navigate to: http://thocong.net/dang-tin.html


I'm developing an app, which will auto post news. When setting value to controls on webpage, all controls are ok, but i cannot to set value to editor (NicEdit). This editor used TextArea tags as instance. I had set value to textarea, but when the news is posted I cannot find contents that set to this textarea. So, pls help me to solve this issue.

Below are codes i'm using to set value to controls on webpages (above link)

HtmlDocument document = webBrowser.Document;
HtmlElement description = document.GetElementById("content");//id of textarea
description .SetAttribute("value", info.Content);

->> Summary: Pls tell me How to set values to nice editor?

Jape answered 1/3, 2011 at 11:57 Comment(0)
V
13

I know this is a very old question but in case you haven't yet found the answer here it is:

nicEditors.findEditor( "your-textarea-id" ).setContent( 'some value' );
Viborg answered 7/6, 2012 at 15:36 Comment(3)
@Viborg it says setContent undefined when I call in jquery.ready()Airdry
Make sure nicEdit's JS file is included beforehand.Viborg
mine has all included, and still setContent is undefined.Homily
T
0

I think you'll find what you need here: http://pastebin.com/sj8QA4xx - it shows how to get use nicEditor's API to insert text at the current cursor location. I am using it successfully to programatically modify a nicEditor's contents. Good luck!

Their answered 3/4, 2012 at 14:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.