Table of Contents

behavior: number

Number input element behavior. If element has step attribute defined then it will rendered with spin buttons.

Elements

that have this behavior applied by default (see master style sheet):

Attributes

that this behavior knows about:

If user will input value that is out of minvalue..maxvalue range then the behavior will create attribute invalid in the element. Therefore element can be styled separately for invalid state.

size, step, minvalue and maxvalue attributes can also be defined in CSS as custom attributes -size, -step, -minvalue and -maxvalue correspndingly. Thus you may define it for group of input elements as:

input.numeric 
{
  behavior:number;
  -step:"1"; 
  -minvalue:"0";
  -maxvalue:"100";
}

Events

Together with the standard set of events (mouse, keyboard, focus) behavior: button generates:

Value

type json::value::V_INT, reflects current status of internal editing buffer.

Special key combinations

See edit

Methods

The behavior supports following xcall() methods (see dom::element::xcall() function):

Note that in Sciter you can access these methods simply as:

  var edit = self.select("input[type='number']");
  edit.min(123);
  var m = edit.min();

Same notation can be used in CSSS!