I'm trying to prepopulate some text in the comment box on a member's profile page. I tried to use tinyMCE.activeEditor.setContent() in the custom code section, but it wasn't working.

Is there some other way I can access the editor or at least access the textarea with javascript to add some text?

Thanks,

Angelo

Views: 107

Reply to This

Replies to This Discussion

There is a code at JenSocial to place a notification box on members profile pages, but I'm not sure if it's one of her premium tips, or basic Ning tips.

Cool, we'll definitely check it out. Maybe this can help us achieve our end game instead of what we have been trying to do. (I'm with the same network as Angelo)

We were able to add some text to the comment box with:

document.getElementById("xg_profiles_chatterwall_post_comment").value = "some text";

Unfortunately, that puts the text directly in the rich text editor (not the HTML) function of the tinyMCE editor, so if I put (character encoded) "<a href="link">link</a>" in the "some text" it displays in the comment as "<a href="link">link</a>" instead of as "link." Not sure how to get around this :-/

Figured it out (noob javascript mistake I think).

I believe the custom code box that we use is fired before all the default ning javascript, so the tinymce functions were being called before tinymce was loaded. This is how I solved the problem:

setTimeout(function(){
tinymce.activeEditor.setContent("some text");
}, 1000);

Setting the delay lets the tinymce script fire first, giving access to the tinymce object and all of the associated functions :-D

RSS

Latest Activity

Riccardo Rossini replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"Me too you can style it in chrome via CSS but not in FF. Thanks"
37 minutes ago
Lady Panter favorited Rafael's group Ning Networks en español
3 hours ago
Dustin Craig replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Thanks!"
5 hours ago
Dustin Craig replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Let me send you a friend request so I can message you rather than take this thread more off-topic."
5 hours ago
Paul Corona replied to Suzie Nielsen's discussion 'Watching Cultivating videos- have questions!'
"So many folks were asking the same questions that I thought actually showing them the basics of the…"
6 hours ago
Chris replied to JFarrow's discussion 'Ning Emails Going to Spam?'
"Nope, had all the answers: "it's not a bug", "it is a bug and has been…"
7 hours ago
Larry Matthews replied to Larry Matthews's discussion 'Photos'
"www.dismyhood.com I need to enlarge images on mouseover, on the activity feeds. There is a feed for…"
8 hours ago
Fabio replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
"F A N T A S T I C !!!!! well done guys"
8 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service