Ask Your Question
1

How to display two wmd editors on same page

asked 2012-06-06 10:18:27 -0500

darkness51 gravatar image darkness51
31 2 1

updated 2012-06-06 10:35:53 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

Hello,

I want have 2 forms on the same page. I edit a log wmd.js to show the toolbar on 2 forms, but when I press a button of the toolbar on the second form, the actions are fired on the first form text area.

How I can fix this?

Best Regards

delete close flag offensive retag edit

Comments

I'm going to edit the title a bit.

Evgeny ( 2012-06-06 10:35:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-06-06 10:34:38 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

updated 2012-06-06 10:37:16 -0500

Askbot's version of wmd editor (note that it is not the same as the "official" version) will not work in more than one copy on a single page, because it uses hardcoded element IDs to assign behavior to DOM elements. Look for any getElementById() calls in the wmd.js.

According to HTML standard it is illegal to have > 1 element on a page with the same ID.

So that needs to be fixed first - probably by allowing to sett unique id's to the parts of different wmd instances. The "id bug" can be fixed by switching to classes, but it would still be necessary to assign unique behavior to the instances, esp. in the cases when contents is to be saved on the server.

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-06-06 10:18:27 -0500

Seen: 55 times

Last updated: Jun 06 '12