AJAX Forms
Repository
svn co svn://pollenation.net/forms/branches/ajax-forms forms
All the ajax specific stuff is going in the aforms module.
Use Cases
- Asynchronous form submitting - submit the form in the background, and then respond to successful or failed submissions by running javascript code.
- Register events on individual fields, allowing activities to take place (i.e. WYSIWYG editors showing output, guided form field entry.)
- A bunch of new more useful widgets - autocomplete text fields, sliders, colour wheels, all the fancy stuff GUI forms have had since year dot.
- Something that could be used heavily throughout a UI: not-really-forms forms. Information boxes that are not form entry fields, but that have "edit" icons alongside them. Click the edit icon, it turns into an editable field. click to submit the field and it greys out, shows a saving icon. Once saved reverts to the normal view mode.
- live validation - validation that requires async, e.g. "username already used" type messages as people complete registration forms.
Enhanced Field Types
- Slider
- Date Picker
- Date Range Picker
Validation
Low hanging fruit: reuse the server-side validators immediately on exiting a field. If available, use provided client-side code to optimise.
On validation failure, activities are different however:
- for client-side only validators, it needs to call a javascript function registered for handling errors on that field,
- for server-side validators, it acts just as the current validators,
- for mixed validators, it calls a page method that can then notify the client. perhaps provide a default that does (1)?
From Paul Reznicek
- required fields labels are *bold* as long as they are empty or with wrong content and after leaving the input field, the label change accordingly
- value checked input's labels are *red* as long as the entered value did not match the allowed range of values (+ there could be a live usage hint, displayed only during the input has wrong/missing value)
- the fire (submit) button is disabled as long as the form is not complete [+ maybe change the value from Please fill all necessary fields to Process depending on form status]
- there can be more buttons with special functions, i.ex.: date manipulation (now | ± day/month/year) for date entry fields and lot of others
- and of course all of this usable together with i18n part of Nevow, so that the messages and labels are in the user's selected language ...
