0

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>
3
Contributors
2
Replies
13
Views
4 Years
Discussion Span
Last Post by Webville312
0

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.

What language is this? Is it JSP or ASP.net? Why did you post this in CSS?

The example has nothing to do with CSS, it seems it involve the database or an array?

Want the solution in html/javascript/ruby on rails.

What solution? What is active? How can anyone add a code with the code you provided? It doesn't make any sense.

0

It is always a good practice to keep your code clean and readable. You could do just that, then re-post it

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.