大家好,我有一些复选框,每个复选框都有与之对应的下拉列表..我想做的是
**when a user checks a checkbox without selecting the dropdown i have to give an alert saying select any value..
**when a user selects value from the dropdown make the corresponding checkbox checked
**and if the user unchecks the checkbox set the dropdown value to default
我的 html 看起来像这样
@foreach(var item in Model.Resources)
{
<div class="select">
<label class="label">
<input type="checkbox" value="@item.Text" id="@item.value"/>
</label>
<div>
<select id="quantity">
<option value="">--select Quantity--</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</div>
}
任何人都可以帮我做这件事吗