Added jQuery support for add and update events.

Changed form handling to use the same validation function for add and
update operations for events.