Number input element behavior. If element has step attribute defined then it will rendered with spin buttons.
that have this behavior applied by default (see master style sheet):
<input type=“number” /> - inline single line <widget type=“number”></widget> that this behavior knows about:
value=integer - initial value of the input elementsize=integer - determines value of (intrinsic and default) width of the element. Default value is 20.minvalue=integer - determines minimum value of the element.maxvalue=integer - determines maximum value of the element.step=integer - if provided shows spin buttons, click on them increments the value correspondingly to this attribute.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";
}
Together with the standard set of events (mouse, keyboard, focus) behavior: button generates:
type json::value::V_INT, reflects current status of internal editing buffer.
See edit
The behavior supports following xcall() methods (see dom::element::xcall() function):
xcall(“min”): int - returns min limit;xcall(“min”, v:int) - sets min limit;xcall(“max”): int - returns max limit;xcall(“max”, v:int) - sets max limit;xcall(“step”): int - returns step value;xcall(“step”, v:int|undefined) - sets/clears step;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!