Hello All,
I am having the drop down list with count 1 to 10 which is looped for itemlist. For item 1 dropdown list shows count 1 to 10,item 2 also dropdown list shows count 1 to 10 and so on. I want to preset the value for the drop down list which should display on page load like for item 1 drop down value count set to 1, for item 2 drop down value count set 2.. and so on. How can i acheive this please let me know. Code is attached for the drop down list. Want the solution in html/javascript/ruby on rails.
<select id="order_of_display" name="order[display]">
<option value="0" selected ="selected">Select order</option>
<% if @items[:active] %>
<%for i in (1..@items[:active].size) %>
<option value=" <%= i %>" > <%= item.id %> </option>
<% end %>
<% end %>
</select>