Reputation: 1740
I am trying to figure out how to, on form submission, to trigger the following styling of form error in Bootstrap.
So the idea is the user submits the form, the controller fails validation (maybe the email address they've submitted on the form has already been used) and the user is returned to the view with the state of the erroring fields marked out thusly (i.e. with a red outline and a red X):
I've seen how to accomplish this client side but not how to trigger it server side. So the form would re-load, in this example the email field would look like the 'Input with error' field of the image attached.
Upvotes: 0
Views: 31
Reputation: 1228
Have the server side code set a hidden variable. On the page load look at the value and detemine which if any of the error formats to use.
Upvotes: 1