Closed tangentfairy-zz closed 9 years ago
Technical spec We have this on the edit dojo form, so it can easily be used as an example. See here https://github.com/CoderDojo/cp-zen-platform/blob/cf2e0c2eaecd208b91fc1bba1e2871e8f155059b/web/public/js/controllers/edit-dojo-controller.js#L36 and here https://github.com/CoderDojo/cp-zen-platform/blob/4674958d8d71c899c4fb199d402b3eb367f02efc/web/public/templates/dojos/dojo-form.dust#L287 for where it is already used.
You'll need to edit here https://github.com/CoderDojo/cp-zen-platform/blob/cf2e0c2eaecd208b91fc1bba1e2871e8f155059b/web/public/templates/dojos/events/dojo-event-form.dust#L265 and add a new function to scroll to validation here https://github.com/CoderDojo/cp-zen-platform/blob/cf2e0c2eaecd208b91fc1bba1e2871e8f155059b/web/public/js/controllers/dojo-event-form-controller.js
This is live now, thanks to @iwtcs and congrats on your first deployed change!
I was creating an event and entered everything but the name, hit publish and nothing happens because I left the name field empty.
Can we have an event on the publish/save click so that if there is a validation error the user is scrolled to the first validation error on the page.