如何制作下拉菜单,其中第二个下拉选项取决于第一个选择?

时间:2012-07-23 15:24:32

标签: html asp.net-mvc drop-down-menu

我想要一个下拉菜单第一个框中的选项是'州'和'省',第二个选项将根据第一个选项填写(州 - >美国州,省 - >加拿大省) 这是我到目前为止的代码:

<form id="updateTreventLocation" action="
<table>

 <%=Url.Action("SavedTreventLocation","Prod")%>" method="post">
  <tr>
        <td colspan="2" class="label">City:</td>
        <td class="content">
            <input type="text" maxlength="100" name="CityLocation" value="<%=EditTreventLocation.locationCity%>" />
        </td>
    </tr>
       <tr>
        <td colspan="2" class="label">Province/State:</td>
        <td class="content">
            <input type="text" maxlength="50" name="ProvinceLocation" value="<%=EditTreventLocation.locationProvince%>" />
        </td>
    </tr>
    </table>
</form>

1 个答案:

答案 0 :(得分:0)

以下链接中的答案可帮助您开始基于第一个动态更新第二个下拉列表。

Populate one dropdown based on selection in another

相关问题