How to reference form controls by their name

This method is consistent with other DOM extensions in that it requires an
element ID as the string argument, not the name of the
form control (as some might think). If you want to reference controls by
their names, first find the control the regular JavaScript way and use the
node itself instead of an ID as the argument.

For example, if you have an input named "company" in a form with an
ID "contact":

var form = $('contact');
var input = form['company'];
Form.Element.getValue(input);
// but, the preferred call is:$(input).getValue(); // we used the $() method so the node gets extended// you can also use the shortcut$F(input);

Note

An error is thrown ("element has no properties") if the element argument
is an unknown ID.