Jochen Dress
2006-Feb-13 16:04 UTC
[Rails] How can I put the error messages generated by the validation routines into it''s own side frame and how can a click on a error message take me right to the error?
Hello, I''m a newbie, coming from Visual FoxPro - a database centric and object orientated scripting language with a rich set of graphical user interface controlls. Lerning ruby on rails means for me to lern html as well. But now to my problem: The validation errors are listed at the top of the page without any order. Depending on the size of the form and the numbers of errors listed the data entry fields containing the corresponding invalid data eventually are out of sight. If the user corrected the value of a field the corresponding error message should indicate that something was done. idea: 1. Bring the error messages into a meaningful order (there have already been posts covering this task) 2. Display the error messages in a side frame with it''s own scrollbar. 3. Make a specific part of the message interactive, so a click of the user on this part will take him right a way to the corresponding data entry field. 4. Change the color of the error message if the field entry was changed. implementation: ??? Thanks in advance Jochen
Bob Silva
2006-Feb-13 20:02 UTC
[Rails] How can I put the error messages generated by the validation routines into it''s own side frame and how can a click on a error message take me right to the error?
For now, you can use my plugin (see signature) to order your fields. I was only 3 days into Ruby/Rails when I wrote it so it definitely needs to be refactored. Eventually, I''ll submit it as patch. As for the display and location, CSS and Javascript are your friends. Another option if you want to get personal, is to generate your own error handling/display using the error_on function. Bob Silva http://www.railtie.net/ -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jochen Dress Sent: Monday, February 13, 2006 8:04 AM To: rails@lists.rubyonrails.org Subject: [Rails] How can I put the error messages generated by the validation routines into it''s own side frame and how can a click on a error message take me right to the error? Hello, I''m a newbie, coming from Visual FoxPro - a database centric and object orientated scripting language with a rich set of graphical user interface controlls. Lerning ruby on rails means for me to lern html as well. But now to my problem: The validation errors are listed at the top of the page without any order. Depending on the size of the form and the numbers of errors listed the data entry fields containing the corresponding invalid data eventually are out of sight. If the user corrected the value of a field the corresponding error message should indicate that something was done. idea: 1. Bring the error messages into a meaningful order (there have already been posts covering this task) 2. Display the error messages in a side frame with it''s own scrollbar. 3. Make a specific part of the message interactive, so a click of the user on this part will take him right a way to the corresponding data entry field. 4. Change the color of the error message if the field entry was changed. implementation: ??? Thanks in advance Jochen _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Andrew Otwell
2006-Feb-13 22:02 UTC
[Rails] How can I put the error messages generated by the
>2. Display the error messages in a side frame with it''s own scrollbar.Ugh. Don''t do that. Scrolling subcontainers or side frames are rarely good UI decisions in HTML pages. If you have so many validation errors that the list is very long, consider placing the error messages adjacent to the fields instead of in a group.>3. Make a specific part of the message interactive, so a click of the > user on this part will take him right a way to the corresponding data > entry field.Great idea. Use the Prototype javascript library to set focus on the field you get the error on. Make sure that the focus is very very obvious, since simply setting the cursor in the field isn''t easy to notice.>4. Change the color of the error message if the field entry was changed.I think this is also a great idea. You''ll might want to submit your form when the user tabs away from each field, and update a div with the relevant errors. The trick is to make sure you *don''t* display an error for a field the user hasn''t yet put a value into. That''s where it gets a little tricky, since you probably also want to insure certain fields aren''t empty. -- Posted with http://DevLists.com. Sign up and save your time!