Title: WP_Editor Validation
Last modified: August 21, 2016

---

# WP_Editor Validation

 *  [odanicola](https://wordpress.org/support/users/odanicola/)
 * (@odanicola)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/wp_editor-validation/)
 * Hi There,
 * Could we give a validation to wp_editor using JQUERY ?

Viewing 1 replies (of 1 total)

 *  [shubham jain](https://wordpress.org/support/users/engshubham2013/)
 * (@engshubham2013)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/wp_editor-validation/#post-4504959)
 * Hi odanicola,
 * Using JQuery, following code validates the character limitation in WordPress 
   Editor, please check this
 *     ```
       <script type="text/javascript">
   
       function check_editor()
       {
       // Regular Expression to remove HTML Tags
           var regX = /(<([^>]+)>)/ig;
       //  WordPress auto added  Your Wp editor id+"_ifr"
           htmlcon =
         jQuery('#your_editor_id_ifr').contents().find("body").html();	
   
       // Replace HTML 
   
          char =  htmlcon.replace(regX, "");
   
       // check character limit
   
          if(char.length > 10)
           {
            alert("Limit Exceed");
            }
           return false;
   
       	}
   
       </script>
   
        <form action="" onsubmit="return check_editor()" method="post">
   
          <?php wp_editor('Some Text','your_editor_id'); ?> 
   
          <input type="submit" name="submit" value="Check" /> 
   
         </form>
       ```
   
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘WP_Editor Validation’ is closed to new replies.

## Tags

 * [validation](https://wordpress.org/support/topic-tag/validation/)
 * [wp_editor](https://wordpress.org/support/topic-tag/wp_editor/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [shubham jain](https://wordpress.org/support/users/engshubham2013/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/wp_editor-validation/#post-4504959)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
