【发布时间】:2021-12-09 01:48:12
【问题描述】:
大家好,在提交我的按钮之前需要点击我的复选框,这是一个 onclick 不提交??
<form>
<p>
<input style="padding:14px; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-radius: 30px; width: 300px; border: none;" placeholder="Enter Date Here... e.g 17/05/1981" />
</p>
<p>
<input type="checkbox" id="vehicle3" name="vehicle3" value="Boat" required="true"> <label style="color: #fff; font-size: 10px;"> Please Accept Terms</label></p>
<p><a id="generateButton" href="generate.html" class="progress-button red" data-loading="Creating..." data-finished="Start Over" data-type="background-vertical" onclick="getRandomImage()">Start Search</a></p>
</form>
【问题讨论】:
-
可以编写一个自定义的JS函数来验证复选框是否被选中。 stackoverflow中有很多答案
-
看看这个Fiddle
-
我有自己的按钮,请参阅上面的代码
标签: javascript html button checkbox submit