如何验证使用validate jquery检查至少一个复选框?

时间:2016-04-07 07:53:22

标签: javascript jquery forms validation

Okey,问题是我有一个必须经过验证的表单,使用jquery验证插件我已经设法验证除了复选框之外的所有问题。所以,这是我的代码:

<form id="myform" class="fs-form fs-form-full" autocomplete="off">
    <label class="fs-field-label fs-anim-upper" for="q3" data-info="This will help us know what kind of service you need">What's your priority for your new website?</label>
    <div id="span-display_box" class="fs-checkbox-group fs-checkbox-custom clearfix fs-anim-lower">
        <span><input class="priority" id="q3a" name="q3[]" type="checkbox" value="mobile"/><label for="q3a" class="checkbox-mobile">Mobile market</label></span>
        <span><input class="priority" id="q3b" name="q3[]" type="checkbox" value="conversion"/><label for="q3b" class="checkbox-conversion">Sell things</label></span>
        <span><input class="priority" id="q3c" name="q3[]" type="checkbox" value="social"/><label for="q3c" class="checkbox-social">Become famous</label></span>
    </div>
    <button class="fs-submit" type="submit" onclick="">Send answers</button>
</form>

那么,使用jquery验证插件我如何验证问题,所以至少检查其中一个?

提前致谢!

0 个答案:

没有答案