Making the combo box as readonly in Haml

245 views Asked by At

I have created a combo box in Haml (Form_tag). I need to make it as not editable and to pass the value while clicking the submit button. I have tried "readonly" property. While using that I can able to edit that. I also tried "disabled" property. But it pass null value for that combo box.

Could you please help me on this?

1

There are 1 answers

0
Karthik On

I got the answer . If we use the readonly attribute in dropdown, it won't work. It will list the values in the dropdown when clicked.

For that we need to disable the dropdown and add a hidden field to that drop down which holds the selected value for that dropdown list.

Thanks, Karthik