Standard single line input element behavior
that have this behavior applied by default (see master_style_sheet):
<input type=“text” /> - inline single line <widget type=“text”></widget> that this behavior knows about:
value=“text” - initial value of the input elementsize=integer - determines value of (intrinsic and default) width of the element.maxlength=integer - maximum number of characters that this element can contain.filter=“filter-expr” - limits set of characters allowed to input in the field. filter-expr string accepts single characters and character ranges. Example: ”.@0~9a~zA~Z” - all alpha-numeric characters, '.' and '@'. If you just want to exclude some characters then you can prepend filter with '^' sign. So this filter=“^.,-” filter will allow to input any character except '.', ',' and '-'. novalue=“text” - if textbox is empty then it shows text provided by the novalue attribute. You can style this state by using :empty CSS selector.Together with the standard set of events (mouse, keyboard, focus) behavior: button generates:
type json::value::V_STRING, reflects current status of internal editing buffer.
Edit supports following xcall() methods (see dom::element::xcall() function):
xcall(“selectionStart”): int - return selection starting position;xcall(“selectionEnd”): int - return selection ending position;xcall(“setSelection”, start:int, end:int):void - sets position of the selection in the edit field;xcall(“selectionText”): string - returns selected text;xcall(“insertText”, text: string):void - inserts text at caret position;xcall(“appendText”, text: string):void - appends text;Note that in Sciter you can access these methods simply as:
var edit = self.select("input[type='text']"); edit.setSelection(0,10); var selStart = edit.selectionStart;