required-from-group.html 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Required From Group</title>
  6. <link rel="stylesheet" href="demo.css">
  7. </head>
  8. <body>
  9. <form class="form" data-validator-option="{timely:2,showOk:''}">
  10. <div class="form-item">
  11. <input type="text" class="contact" name="mobile" placeholder="手机号"
  12. data-rule="required(from, .contact); mobile"
  13. data-msg-required="请至少填写一种联系方式">
  14. </div>
  15. <div class="form-item">
  16. <input type="text" class="contact" name="tel" placeholder="电话"
  17. data-rule="required(from, .contact); tel">
  18. </div>
  19. <div class="form-item">
  20. <input type="text" class="contact" name="email" placeholder="邮箱"
  21. data-rule="required(from, .contact); email">
  22. </div>
  23. <div class="form-item">
  24. <button type="submit">提交</button>
  25. </div>
  26. </form>
  27. <script src="https://cdn.jsdelivr.net/jquery/1.12.3/jquery.min.js"></script>
  28. <script src="../dist/jquery.validator.min.js?local=zh-CN"></script>
  29. </body>
  30. </html>