CRM-14925 - count up the characters in use, not down from the max
authorJamie McClelland <jm@mayfirst.org>
Fri, 27 Jun 2014 16:46:06 +0000 (12:46 -0400)
committerJamie McClelland <jm@mayfirst.org>
Fri, 27 Jun 2014 16:46:06 +0000 (12:46 -0400)
----------------------------------------
* CRM-14925: SMS interface should count the characters entered, not count down
  https://issues.civicrm.org/jira/browse/CRM-14925

templates/CRM/Contact/Form/Task/SMSCommon.tpl

index e6c94818fe9f22dd05f9c65be541b09594ed2fb6..8f2e1c78e7e5a2af5a4e4d0d18d9d58a2188f419 100644 (file)
@@ -84,13 +84,13 @@ return true;
 function maxCharInfoDisplay(){
    var maxLength = {/literal}{$max_sms_length}{literal};
    var enteredCharLength = cj('#text_message').val().length;
-   var count = maxLength - enteredCharLength;
+   var count = enteredCharLength;
 
    if( count < 0 ) {
       cj('#text_message').val(cj('#text_message').val().substring(0, maxLength));
       count = 0;
    }
-   cj('#char-count-message').text( "You can insert upto " + count + " characters" );
+   cj('#char-count-message').text( "You can insert up to " + maxLength + " characters. You have entered " + count + " characters." );
 }
 {/literal}{/if}{literal}