开发者

Formtastic change style of input boxes on validation errors

I am using the formtastic gem to generate the forms for my project. Rather than display 开发者_JAVA百科an inline error I would prefer to change the style of the input boxes. Does anyone know of a way to do this?


You should be able to achieve this with just css. Formtastic has an "error" class. You can change the style of inputs inside this class:

form.formtastic fieldset > ol > li.error input{ /** your style here **/ }

Then you can change the style of the inline-errors class to display none:

form.formtastic fieldset > ol > li p.inline-errors{ display:none; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜