Form
Although form dijits can be wrapped in an HTML form tag, the dijit.form.Form dijit provides some
additional conveniences that are quite useful. This section rounds off
the chapter by reviewing ordinary HTML forms and then reviews the
specific features provided by dijit.form.Form. A common source of
confusion to many Dijit newcomers is that they expect Dijit to do
something directly that already works just fine via ordinary HTML.
Recall that a significant part of Dojo's design philosophy is to not
reinvent aspects of web technologies that already work; rather, Dojo
supplements and augments as needed where web technology is lacking or
not standardized.
HTML Form Tag Synopsis
dijit.form.Form respects
the standard form attributes as
defined in the HTML 4.01 specification. All attribute values are
assumed to be wrapped in quotes as string values, although DOM
events such as onclick entail
explicitly denoting that a script action is expected, like onclick="javascript:someScriptAction( )"
or onclick="javascript:return
someValidationAction( )". For mouse events, a "left-click"
action is assumed.
Form
The Form dijit itself
supplements the standard HTML form attribute by providing several
methods that may be called to manipulate it directly, and one
extension point that is called internally in response to a user
action. Table 13-16 lists
the key aspects of Form.
Table 13-16. Form methods and extension points
Name | Category | Comment |
|---|---|---|
| Method | Returns a JSON structure providing named key/value ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access