ASP.NET (6) Books (3) DOTNET (4) javascript (5) Jquery (5) Live Tv (1) Project (1) Summernote Editor (3)
Showing posts with label Summernote Editor. Show all posts
Showing posts with label Summernote Editor. Show all posts

Tuesday, March 7, 2017

How to validate Summernote using javascript/jquery and reset the value

In this article I am going to show you how to validate and reset Summernote (To know more about summernote click on link). 

So, for this firstly we get the value of editor and store in a variable just like (Editor is id of summernote) :


   1:  var code = $('#Editor').summernote('code');
 
After this we replace symbols like <, >, /  with space ' ', because of the default value of summernote is '<p> <br/> &lt/;p>'
 Final code is :


   1:   var code = $('#Editor').summernote('code');
   2:          var filteredContent = (code).replace(/\s+/g, '');
   3:   
   4:          if (filteredContent.length == 0) {
   5:              $('.note-editable').css({ 'border': 'solid 1px red' }).focus();
   6:              //  if summernote is empty          
   7:              isValid = false;
   8:          }
   9:   

Now, for reset the summernote value :


   1:   $('#Editor').summernote('code', '');
 
I hope ,it will help you.

Tuesday, February 28, 2017

Summernote not working or Icon not fully renderedd or css not working (Missing Editor Icons)

In my last article I have shown you how to use summernote using CDN. But when you download and use JS and css file to your local project folder then icon not display in editor something like :



This is because of the summernote css file is using font from CDN url  and not able to find path of that.So, to use summernote please make sure you are added all folder content to your project. you can download link from below :

http://summernote.org/getting-started/

OR

https://github.com/summernote/summernote/releases/download/v0.8.2/summernote-0.8.2-dist.zip

It would help you.

Monday, February 27, 2017

How to use HTML Editor (Summernote) in asp.net c#



In this article I am going to tell how to use HTMl editor in simple and easy way using Summernote super easy editor.


So, for this we need five plug-ins, I am giving CDN link below you can download from it.


After this,

First create a new project or website in Visual studio.

And add following code:



This will give the output some like  :







Most important line to add in your page directive is  :

 ValidateRequest="false" 

So, when you run this code and click on the save button you might be getting this error something like:

 
 To remove this error Add this in you web.config inside system.web tag:
Related Posts Plugin for WordPress, Blogger...