focus

sets focus into the necessary component

void focus(string item);

Parameters

itemstringID or name of the form element

Example

//htmlform
<input type="button" value="Focus author" onclick="focus_form('author');" /> 
<input type="button" value="Focus genre" onclick="focus_form('genre');" />
 
            ...
function focus_form(item) {
    if (!item)
        $$('htmlform1').focus();
    else
        $$('htmlform1').focus(item);
}

Details

If applied without parameter, the function sets focus on the whole component.

See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript dashboard framework and page of form widget product.