【发布时间】:2020-09-23 21:51:53
【问题描述】:
我正在构建一个注册表单。如果选择的注册类型(单选按钮)是“Self”,我想用“1”预填充“票数”字段。 我的代码:
index.html
<div class="containerx">
<h2>Registration type: </h2>
<ul id="ullu">
<li>
<input type="radio" id="f-option" name="regType" value="Self" required>
<label for="f-option">Self</label>
<div class="check"></div>
</li>
<li>
<input type="radio" id="s-option" name="regType" value="Group" required>
<label for="s-option">Group</label>
<div class="check"></div>
</li>
<li>
<input type="radio" id="t-option" name="regType" value="Corporate" required>
<label for="t-option">Corporate</label>
<div class="check"></div>
</li>
<li>
<input type="radio" id="fo-option" name="regType" value="Others" required>
<label for="fo-option">Others</label>
<div class="check"><div class="inside"></div></div>
</li>
</ul>
</div>
<fieldset class="form-fieldset ui-input __first" style="z-index: 0">
<input type="number" required id="ticket" tabindex="0" name="ticketNo" min="1" max="25"/>
<label for="ticket">
<span data-text="Number of Tickets (Not more than 25)">Number of Tickets (Not more than 25)</span>
</label>
</fieldset>
【问题讨论】:
标签: javascript html jquery forms radio-button