Comment box works well with <textarea>
but I need to use div
in place of it.
here is text area code:
<textarea class="commentMark" id="commentMark-<?php echo $row['p_id'];?>" onblur="if (this.value=='') this.value = 'Write a comment'" onfocus="if (this.value=='Write a comment') this.value = ''" onKeyPress="return SubmitComment(this,event)" wrap="hard" name="commentMark" style=" background-color:#fff; overflow: hidden;" cols="60">Write a comment</textarea>
I tried to replace it with contenteditable
div
<div class="commentMark" id="commentMark-<?php echo $row['p_id'];?>" onblur="if (this.value=='') this.value = 'Write a comment'" onfocus="if (this.value=='Write a comment') this.value = ''" onKeyPress="return SubmitComment(this,event)" wrap="hard" name="commentMark" style=" background-color:#fff; overflow: hidden;" cols="60">Write a comment</div>
But in text area when I press enter comment get posted. While in div when I enter it does not make any effect.
also div appears with clicking on the "comment" button