Rails form_for select, invalid selected when disabled: true -


can guys me little problem? select tag:

<%= f.select :department_id, options_for_select(department.in_order.map {|d| [d.name, d.id]}, obj.department_id), { prompt: true }, class: 'form-control input-sm', disabled: lambda {action_name == 'revise'} %>

if disabled: true set, "department invalid" error on validation. when not set, fine.

this due fact html fields when disabled not submitted form. need readonly. readonly gives same functionality disabled still submitted form.

http://www.w3schools.com/tags/att_input_readonly.asp


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -