if a text_field_tag form helper in rails is disabled, does it not submit?
Asked Answered
B

1

11

I have a text_field_tag in my form, i really want it just for display (all my jquery updates this text field), using a date picker. Though I don't want the user to type in here, so I said the :disabled => true and sure enough it is disabled, values change here but in my ajax remote call they do not save, only if that text_field_tag is enabled does it save. Is there any work around this?

Britneybritni answered 25/2, 2013 at 21:26 Comment(0)
O
27

Use :readonly => true instead.

An important difference between readonly and disabled is that disabled does not include the field when the form is submitted while readonly does.

Overload answered 25/2, 2013 at 23:59 Comment(1)
I don't know how i missed that. Thanks!Britneybritni

© 2022 - 2024 — McMap. All rights reserved.