Getting started : get & set code[
^]
$('#summernote').summernote({
tabsize: 2,
height: 150
});
var description = $('#long_Description').val();
$('#summernote').summernote('code', description);
It may be simpler to just turn the original input element into the editor, rather than using a
div
:
<div class="form-group">
@Html.LabelFor(model => model.long_Description, htmlAttributes: new { @class = "control-label col-md-4" })
<div class="col-md-10">
@Html.TextAreaFor(model => model.long_Description, new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.long_Description, "", new { @class = "text-danger" })
</div>
</div>
<script>
$(function(){
$("#long_Description").summernote({
tabsize: 2,
height: 150
});
});
</script>