Add Profile Field for Short Bio - Show Characters left
Design and Skin Customization
its possible to do by changing form_field_elements.tpl to this:
{if $type == 'textarea' && !isset($theme)}
{if $max > 0}
<script language="JavaScript">
$("#{$name}").charCount({ allowed: {$max}, warning: 20, mainID: '{$name}' });
</script>
<span class="" id="{$name}_counter">{$min}:<span id="{$name}_num">{$max}</span></span>
{/if}
<a onclick="var e=$(this).prev();var h=e.height() + 100;e.animate( { height: h +'px' } , 250);">{jrCore_icon icon="arrow-down" size="16"}</a>
{/if}
and /jrAction/js/char_count.js to this:
(function($) {
$.fn.charCount = function(options){
var defaults = {
allowed: 140,
warning: 20,
cssWarning: 'action_warning',
cssExceeded: 'action_exceeded',
mainID: 'action_text'
};
var options = $.extend(defaults, options);
function calculate(obj){
var count = $(obj).val().length;
var available = options.allowed - count;
if (available <= options.warning && available >= 0){
$('#'+options.mainID+'_counter').addClass(options.cssWarning);
} else {
$('#'+options.mainID+'_counter').removeClass(options.cssWarning);
}
if (available < 0){
$('#'+options.mainID+'_counter').addClass(options.cssExceeded);
} else {
$('#'+options.mainID+'_counter').removeClass(options.cssExceeded);
}
$('#'+options.mainID+'_num').html(available);
};
this.each(function() {
calculate(this);
$(this).keyup(function(){calculate(this)});
$(this).change(function(){calculate(this)});
});
};
})(jQuery);
But I'm not sure if that should go into core or not, ill ask the others. It will make having Javascript turned on necessary rather than optional for that to work.
See what they say.