octubre 27, 2009 at 4:55 pm

Making errors look good

Categorías:  general

There are many html forms on XING – when you sign up, when you write a message, or when you discuss in a group. We do most of our form validations on the server side. This allows us to apply complex validations, prevents code duplication, and apply security checks.
This works well – you define the requirements for the specific field (such as <input>) and Rails returns the page with an error message, also highlighting the corresponding field in red. Sounds good, but that’s actually where the problem is. Rails surrounds the field with a <div> that is styled via CSS.
This additional <div> may lead to CSS problems especially in pixel-precise layouts such as the XING html forms, it may break the HTML structure – and it will add completely unneeded DOM complexity.
Changing how Rails handles fields with errors
The technical details of how we solved it follow. We were not the first ones [...]

Escribe un comentario

  • Comentarios recientes

  • Categorías

  • Archivo

  •