Bootstrap-wysihtml5: content uneditable

242 views Asked by At

I'm trying to implement bootstrap-wysihtml5 by jhollingworth.

On one of my pages it works perfectly, but on a different page the content is uneditable. The code is almost identical (except for layout, ...), but if I do "Inspect Element" in Google chrome, I see 2 different outputs.

Working code:

<table>
<tr>
<td>
<textarea id="msgcompose_msg"></textarea>
<script>
$(document).ready(function() {
    $("#msgcompose_msg").wysihtml5();
});
</script>
</td>
</tr>
</table>

Output: http://i.imm.io/1gGDY.png

Not working code:

<p>
<textarea id="forum_topic_view_reply_reply"></textarea>
<script>
$(document).ready(function() {
    $("forum_topic_view_reply_reply").wysihtml5();
});
</script>
</p>

Output: http://i.imm.io/1gGEy.png

Personally I don't know why the output is different

1

There are 1 answers

2
Hive7 On

Found the error it was in this line:

$("forum_topic_view_reply_reply").wysihtml5();

You need this instead:

$("#forum_topic_view_reply_reply").wysihtml5();

As there was no hashtag on the second instance of it the page was looking for a tag called forum_topic_view_reply_reply not an id