Index: lams_tool_forum/web/jsps/learning/message/bodyarea.jsp =================================================================== diff -u -r24ebb6c91f49a10f1e5718036b3a3c1a80c3314f -rb7aaf1918d51259a93067809b0d1627c2017be33 --- lams_tool_forum/web/jsps/learning/message/bodyarea.jsp (.../bodyarea.jsp) (revision 24ebb6c91f49a10f1e5718036b3a3c1a80c3314f) +++ lams_tool_forum/web/jsps/learning/message/bodyarea.jsp (.../bodyarea.jsp) (revision b7aaf1918d51259a93067809b0d1627c2017be33) @@ -12,9 +12,7 @@ <%-- Does not use general tag because this field need keep compatible with CKEditor's content --%> - - - + ${messageForm.message.body} @@ -42,7 +40,7 @@ var counter = function(evt) { var value = isCkeditor ? ckeditor.getSnapshot() - : $('textarea#messageBody').val(); + : $('textarea[id="message.body__lamstextarea"]').val(); var charactersCount = getNumberOfCharacters(value, isCkeditor); //limit is not exceeded @@ -76,8 +74,7 @@ this.value = this.value.substring(0, limit); //fix a bug: when change "this.value", onchange event won't be fired any more. So this will //manually handle onchange event. It is a kind of crack coding! - filterData(document.getElementById('messageBody')); - + filterData(document.getElementById('message.body__lamstextarea'),document.getElementById('message.body__lamshidden')); } }; @@ -94,7 +91,7 @@ ckeditor.on('instanceReady', counter); } else { - $('textarea#messageBody').on('change keydown keypress keyup paste', counter); + $('textarea[id="message.body__lamstextarea"]').on('change keydown keypress keyup paste', counter); //count characters initially counter(); } @@ -115,7 +112,7 @@ //character count fuction var counter = function() { var value = isCkeditor ? ckeditor.getSnapshot() - : $('textarea#messageBody').val(); + : $('textarea[id="message.body__lamstextarea"]').val(); var charactersCount = getNumberOfCharacters(value, isCkeditor); @@ -136,7 +133,7 @@ ckeditor.on('instanceReady', counter); } else { - $('textarea#messageBody').on('change keydown keypress keyup paste', counter); + $('textarea[id="message.body__lamstextarea"]').on('change keydown keypress keyup paste', counter); //count characters initially counter(); }