Login Register

Form Widget

Although you're not required to place Dijit form elements in a dijit.form.Form, doing so gets you some nice methods and extension points to use.

dijit.form.Form
Adds conveniences to regular HTML form.
Methods
getValues generate JSON structure from form values get widget values
isValid Return true if every widget's isValid method returns true.
setValues fill in form values from a JSON structure generate map from name --> [list of widgets with that name]
submit programatically submit form
Extension Points
execute User defined function to do stuff when the user hits the submit button

Callbacks?

By Callback do you mean Extension Point? It would be really nice to have an example here as well. Or, maybe even better, is extend the first example in "Part 1: Life with Dojo" to at least show the Dojo way of controlling form submission. Thanks.

getValues/setValues working in 1.0?

I can't get getValues() to work with checkboxes (haven't tried other form inputs yet), and I see large "TODO" items in both setValues() and getValues() in the Form.js source. Is this supposed to be supported? Or should we use dojo.formToObject() instead?

Examples?

I can not find one example of using this dijit anywhere for forms -- can anyone point me in the right direction? Perhaps an example is needed on this page?

Thanks.

This may be helpful,

This may be helpful, although its intended purpose is for doh testing, so some of the source should be ignored:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/form/Form...

Ah!

Yes very helpful - thx!