There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

if-max-length

Syntax

if-max-length: ("string"|element) integer;

This conditional action will return true if the specified string has a length that is less than or equal to the specified integer.

string = The string you want to check. This can contain any valid Active CSS variable, such as an attribute or an ajax response variable.

element = Selector reference to an element. If it is an input tag, it will use it's value. If textarea, it will use it's content. Any other type of selector it will compare its innerText.

integer = The maximum length of the string allowed for the conditional to pass.

For example, this will return true if the element #myInput has string content that has a maximum of 10 characters.

@conditional maxInput {
    if-max-length: #myInput 10;
}

When used on an event selector with no string/element in parentheses, it will default to checking "self". Eg. #myInput:if-max-length(10): ...

if-max-length