Changes between Initial Version and Version 2 of Ticket #6005


Ignore:
Timestamp:
Feb 26, 2008, 10:29:40 PM (13 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6005

    • Property Cc bill added
    • Property Owner set to nathan
    • Property Summary changed from [cla][patch] Suggestion: enhance dijit.form.Form.isValid to [cla][patch] Form.validate() will indicate errors in the form
  • Ticket #6005 – Description

    initial v2  
    1 It would be nice to have the ability to pass in a flag to dijit.form.Form.isValid which would allow for it to call validate() on each of its sub widgets at the same time as it is checking validation.  Since the widgets set their visual class in their validate() function, it is a simple way to visually expose to the user that things aren't quite right.
     1Make 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.
    22
    3 The first invalid entry should also be focus()-ed...that's a fairly standard web practice.
    4 
    5 A patch follows.
     3Implementation 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.