focus

sets focus into the necessary component

void focus(string item);
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