Documentation

focus

sets focus into the necessary component

void focus(string item);

Parameters

itemstringID or name of the form element

See also

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 with no parameter, the function sets focus on the whole component.

Back to top