Improvements to FormManager JavaScript class

2 views
Skip to first unread message

Alexander Obuhovich

unread,
May 18, 2012, 6:55:00 AM5/18/12
to In-Portal Development
In In-Portal we've developed FormManager class, that is used to manage forms that are submitted and validated through ajax.

I wanted to share several improvements we've made to original version we've used quite a lot over last years:
  1. set error into a field before form is registered
  2. set form-specific template to be used in all ajax calls
  3. perform immediate validation for inputs on blur event, but for other controls (like radio buttons) in click event
  4. if event, called through AjaxFormHelper::transitEvent method requested a redirect to another page (e.g. by setting $event->redirect property), then automatically perform redirect
  5. watermarks were not removed when using immediate field validation
  6. watermark removal code (that was called before form submit) first removed watermarks and then restored them, but should be restoring original values in these fields
  7. error were not removed from form after it was closed by user (without submitting)


Ready for testing.


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
form_manager_improvements_core.patch
form_manager_improvements_themes.patch
Reply all
Reply to author
Forward
0 new messages