monster.ui.charsRemaining()

Syntax

monster.ui.charsRemaining($target, args);

Parameters

KeyDescriptionTypeDefaultRequired
$targetForm element to be checked.jQuerytrue
argsAguments to setup the helperObject(#/args)false

args

KeyDescriptionTypeDefaultRequired
sizePrevent the user to enter more than this number of charactersNumber0false
customClassCustom class for the label if neededStringfalse

Errors

  • "$target" is not a jQuery object: $target is not a jQuery element
  • "args" is not a plain object: args is defined but not a plain object

Description

The monster.ui.charsRemaining() method indicates the remaining count of characters in $target up to args.size.

Example

// myTemplate.html
<div>
  <input type="text" name="summary" id="summary">
</div>
var $template = $(appContext.getTemplate({
    name: 'myTemplate'
  }));

monster.ui.charsRemaining($template.find('#summary'), {
  size: 50
});