Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<select name="SelectedInventoryTypes" id="SelectedInventoryTypes" multiple="multiple" data-native-menu="false" data-icon="grid" data-iconpos="left">
                   <option>Tipos Inventario</option>
                   @foreach (var item in Model.InventoryTypes)
                   {
                       if (Model.SelectedInventoryTypes != null && Model.SelectedInventoryTypes.Contains(item.Value))
                       {
                           <option value="@item.Value" selected>@item.Text</option>
                       }
                       else
                       {
                           <option value="@item.Value">@item.Text</option>
                       }


What I have tried:

when i tried to disable the data is not fetch from database but when i enable the dropdown the data is fetch and its working help me to resolve this problem.
Posted
Comments
F-ES Sitecore 21-Jun-19 3:46am    
Disabled form elements are not submitted with the form. If you want data in the form that is "read only" then store it in a hidden input field

<input type="hidden" value="...." />
Member 14328423 21-Jun-19 7:44am    
where do I put this , will you please explain it properly
F-ES Sitecore 21-Jun-19 8:54am    
You can put it anywhere inside the form, it doesn't appear on the page so it doesn't matter. You haven't provided enough detail about what you're doing to give specific code, but in whatever event you hook into where you disable the dropdown, at the same time update the value of a hidden input field (make sure the field has a "name" attribute) and you can retrieve the data via the hidden field rather than your dropdown.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900