From: Jamie McClelland Date: Fri, 27 Jun 2014 16:46:06 +0000 (-0400) Subject: CRM-14925 - count up the characters in use, not down from the max X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3ccff713dafa9d2d215f88bdb8838c54d41f33d0;p=civicrm-core.git CRM-14925 - count up the characters in use, not down from the max ---------------------------------------- * CRM-14925: SMS interface should count the characters entered, not count down https://issues.civicrm.org/jira/browse/CRM-14925 --- diff --git a/templates/CRM/Contact/Form/Task/SMSCommon.tpl b/templates/CRM/Contact/Form/Task/SMSCommon.tpl index e6c94818fe..8f2e1c78e7 100644 --- a/templates/CRM/Contact/Form/Task/SMSCommon.tpl +++ b/templates/CRM/Contact/Form/Task/SMSCommon.tpl @@ -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}