【发布时间】:2019-04-19 06:23:59
【问题描述】:
我目前在我的 asp 表单组中有 2 个选项值,其中一个代表国家,另一个代表州/省。有什么办法可以互换文字吗?
For example when user selects canada the placeholder text will be province where when U.S is selected the placeholder will be State.
<form>
<div class="form-group">
<select asp-for="Country" class="form-control" required="required">
<option value="Canada">Canada</option>
<option value="U.S">U.S</option>
</select>
</div>
<div class="form-group">
<input asp-for="State" class="form-control" placeholder="Province" />
<span asp-validation-for="State" class="text-danger"></span>
</div>
<button type="submit"> Submit </button>
<form>
【问题讨论】:
标签: c# asp.net asp.net-mvc forms