mconf-web icon indicating copy to clipboard operation
mconf-web copied to clipboard

Errors in forms on modal windows are usually lost

Open mconf-daileon opened this issue 8 years ago • 1 comments


Author Name: Leonardo Daronco (Leonardo Daronco) Original Redmine Issue: 1355, http://dev.mconf.org/redmine/issues/1355


When there's a form in a modal window, the user submits it and there's an error, the modal window is closed and the errors are usually lost, unless they are caught and show as a notification. Ideally the errors should appear near the inputs, as simple_form does by default for all forms. In modals this is trickier, because the modal closes when the form is submitted and doesn't open again when the page reloads.

One possible solution is to submit it via javascript, get the result, parse and show the errors in the form. It's a lot more work, and if done should be done in a way that works for all forms. Maybe even forms that are not in modals.

mconf-daileon avatar May 08 '16 15:05 mconf-daileon


Original Redmine Comment Author Name: Leonardo Daronco (Leonardo Daronco) Original Date: 2016-04-08T15:47:06Z


A few more points to be considered:

  1. Use standard responses in controllers, regardless of whether the view will be rendered in a modal or as a full page. The page also needs to look good both as a normal page or as a modal.
  2. Modals could submit the forms via js, test the responses and show the errors without reloading the page. This should be done in a generic way that works for all modals. An idea would be to consider using client-side javascript libraries to do it.

mconf-daileon avatar May 08 '16 15:05 mconf-daileon