MyBB Community Forums

Full Version: 2 or more editors (codebuttons) - working only first
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey. I have two textarea on the page. First with id "comment_1", second with id "comment_2". After it i have $codebuttons_1 and $codebuttons_2.

In php i am build inserter for their.
$codebuttons_1 = build_mycode_inserter("comment_1");
$codebuttons_2 = build_mycode_inserter("comment_2");

In the page source I've:
<textarea name="comment_2" id="comment_2" rows="10" cols="70"></textarea>
<!-- start: codebuttons -->
<script type="text/javascript" src="jscripts/editor.js?ver=1400"></script>
<script type="text/javascript">
<!--
	var editor_language = {
	title_bold: "Insert bold text",
	title_italic: "Insert italic text",
	title_underline: "Insert underlined text",
	title_left: "Align text to the left",
	title_center: "Align text to the center",
	title_right: "Align text to the right",
	title_justify: "Justify text",
	title_numlist: "Insert numbered list",
	title_bulletlist: "Insert bulleted list",
	title_image: "Insert image",
	title_hyperlink: "Insert hyperlink",
	title_email: "Insert email address",
	title_quote: "Insert quoted text",
	title_code: "Insert formatted code",
	title_php: "Insert formatted PHP code",
	title_close_tags: "Close any open MyCode tags that you currently have open",
	enter_list_item: "Enter a list item. Click cancel or leave blank to end the list.",
	enter_url: "Please enter the URL of the website.",
	enter_url_title: "Optionally, you can also enter a title for the URL.",
	enter_email: "Please enter the email address you wish to insert.",
	enter_email_title: "Optionally, you may also enter a title for the email address.",
	enter_image: "Please enter the remote URL of the image you wish to insert.",
	size_xx_small: "XX Small",
	size_x_small: "X Small",
	size_small: "Small",
	size_medium: "Medium",
	size_large: "Large",
	size_x_large: "X Large",
	size_xx_large: "XX Large",
	font: "Font",
	size: "Text Size",
	color: "Text Color"
};
	var clickableEditor = new messageEditor("comment_2", {lang: editor_language, rtl: 0, theme: "default"});
	if(clickableEditor)
	{
		clickableEditor.bindSmilieInserter("clickable_smilies");
	}
// -->
</script>

and

<textarea name="comment_1" id="comment_1" rows="10" cols="70"></textarea>
<!-- start: codebuttons -->
<script type="text/javascript" src="jscripts/editor.js?ver=1400"></script>
<script type="text/javascript">
<!--
	var editor_language = {
	title_bold: "Insert bold text",
	title_italic: "Insert italic text",
	title_underline: "Insert underlined text",
	title_left: "Align text to the left",
	title_center: "Align text to the center",
	title_right: "Align text to the right",
	title_justify: "Justify text",
	title_numlist: "Insert numbered list",
	title_bulletlist: "Insert bulleted list",
	title_image: "Insert image",
	title_hyperlink: "Insert hyperlink",
	title_email: "Insert email address",
	title_quote: "Insert quoted text",
	title_code: "Insert formatted code",
	title_php: "Insert formatted PHP code",
	title_close_tags: "Close any open MyCode tags that you currently have open",
	enter_list_item: "Enter a list item. Click cancel or leave blank to end the list.",
	enter_url: "Please enter the URL of the website.",
	enter_url_title: "Optionally, you can also enter a title for the URL.",
	enter_email: "Please enter the email address you wish to insert.",
	enter_email_title: "Optionally, you may also enter a title for the email address.",
	enter_image: "Please enter the remote URL of the image you wish to insert.",
	size_xx_small: "XX Small",
	size_x_small: "X Small",
	size_small: "Small",
	size_medium: "Medium",
	size_large: "Large",
	size_x_large: "X Large",
	size_xx_large: "XX Large",
	font: "Font",
	size: "Text Size",
	color: "Text Color"
};
	var clickableEditor = new messageEditor("comment_1", {lang: editor_language, rtl: 0, theme: "default"});
	if(clickableEditor)
	{
		clickableEditor.bindSmilieInserter("clickable_smilies");
	}
// -->
</script>

And the problem is working only one of editors.
[attachment=14427]

Need help Smile.
Not sure but I think it will only work for 1 textarea on a page. Can't say for sure as I have not yet looked into it.
Then how to recode it for more textareas Toungue.



Any1 else?
What is this have to my problem?

I need it to my new page (plugin/module).