Character Counter For SMS Text Message - SMS Counter

Character Counter For SMS Text Message - SMS Counter
File Size: 7.16 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

SMS Counter is a simple-to-use jQuery character counter plugin especially created for SMS text messages.

The plugin creates a summary panel under the textarea that displays Encoding, Length, Messages, Per Message, and Remaining Characters of your SMS message.

How to use it:

1. Create a regular textarea element for the SMS text message.

<textarea name="message" id="message">
  Your text message here
</textarea>

2. Create the summary panel under the textarea.

<ul id="sms-counter">
  <li>Encoding: <span class="encoding"></span></li>
  <li>Length: <span class="length"></span></li>
  <li>Messages: <span class="messages"></span></li>
  <li>Per Message: <span class="per_message"></span></li>
  <li>Remaining: <span class="remaining"></span></li>
</ul>

3. Insert jQuery library and the jQuery SMS Counter plugin's script into the page.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="sms_counter.min.js"></script>

4. Call the function to enable the SMS counter.

$(function(){

  $('#message').countSms('#sms-counter');

});

This awesome jQuery plugin is developed by danxexe. For more Advanced Usages, please check the demo page or visit the official website.