Opened 11 years ago

Closed 11 years ago

#6005 closed enhancement (fixed)

[cla][patch] Form.validate() will indicate errors in the form

Reported by: nathan Owned by: Douglas Hays
Priority: high Milestone: 1.1
Component: Dijit Version: 1.1b1
Keywords: Cc: bill
Blocked By: Blocking:

Description (last modified by bill)

Make Form.validate() turn all the invalid or required-but-blank fields yellow, and focus on the first invalid (or required-but-blank) field. It is a way to visually expose to the user that things aren't quite right.

Implementation notes: widget.isValid() won't be removed. widget.validate is extended to return the valid state (a boolean). Form.validate is a new method that calls widget.validate for each field - and in the event that one of them is invalid, it focuses on the first invalid.

Attachments (3)

FormValidation.patch (1.6 KB) - added by nathan 11 years ago.
Patch which adds: 1 - dijit.form.Form.validate(), 2 - returns the boolean state from ValidationTextBox?.validate (and all subclasses), 3 - adds a testcase
FormValidation.2.patch (3.6 KB) - added by nathan 11 years ago.
Update to formValidationPatch - which contains a test case.
FormValidation.2.3.patch (2.6 KB) - added by nathan 11 years ago.
Updated patch - fixes scrolling tooltip issue and moves test case into Form.html

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by Douglas Hays

Cc: bill added
Owner: set to Douglas Hays

Needs further discussion...

comment:2 Changed 11 years ago by bill

Description: modified (diff)
Owner: changed from Douglas Hays to nathan
Summary: [cla][patch] Suggestion: enhance dijit.form.Form.isValid[cla][patch] Form.validate() will indicate errors in the form

comment:3 Changed 11 years ago by nathan

Cc: nathan added; nathan@… removed
Status: newassigned

comment:4 Changed 11 years ago by nathan

Cc: nathan removed
Reporter: changed from guest to nathan

Changed 11 years ago by nathan

Attachment: FormValidation.patch added

Patch which adds: 1 - dijit.form.Form.validate(), 2 - returns the boolean state from ValidationTextBox?.validate (and all subclasses), 3 - adds a testcase

comment:5 Changed 11 years ago by nathan

Owner: changed from nathan to Douglas Hays
Status: assignednew

Changed 11 years ago by nathan

Attachment: FormValidation.2.patch added

Update to formValidationPatch - which contains a test case.

Changed 11 years ago by nathan

Attachment: FormValidation.2.3.patch added

Updated patch - fixes scrolling tooltip issue and moves test case into Form.html

comment:6 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [12731]) Fixes #6005. Proxy commit for nathan. Added Form.validate() method that focuses the first invalid widget found. Changed widget.validate() method to return isValid boolean.

Note: See TracTickets for help on using tickets.