2

我正在试验节点 Js。如何创建动态下拉菜单?谢谢。

4

1 回答 1

6
<div class="control-group">
   <%- form.label("state_or_province", false, {class: "control-label"}) %>
   <div class="controls">
   <!--       <%- form.input("state_or_province") %> -->
     <select id="Facility_state_or_province" name="Facility[state_or_province]" size="1">
       <% state_or_province_list.forEach(function (state_or_province_entry) { %>
         <option value = "<%= state_or_province_entry.lookup_code %>" <%= (facility.state_or_province != null) && (facility.state_or_province == state_or_province_entry.lookup_code) ? 'selected = "selected"' : '' %>><%= state_or_province_entry.meaning %></option>
   <% }); %>  
 </select>
    </div>
</div>
于 2012-09-30T19:44:58.920 回答