1. <section style="width:90%; margin:0 auto; font-size: 16px;">
    2. <div class="aui-content-up">
    3. <form action="" name="form1" method="post">
    4. <div style="text-align:center; margin-top:30px; padding-bottom:20px; margin-bottom:20px; border-bottom: 1px solid red">
    5. <h2>表单预约</h2>
    6. </div>
    7. <div class="aui-form-group clear">
    8. <label class="aui-label-control">
    9. 姓名 <em>*</em>
    10. </label>
    11. <div>
    12. <input style="width:180px; line-height: 30px; padding-left:5px; margin: 8px 0; font-size:16px;" type="text" class="aui-form-control-two" name="yourname" onBlur="checkna()" required id="1" placeholder="请输入姓名">
    13. <span style="margin-left:5px;" id="divname">长度1~6个字符</span>
    14. </div>
    15. </div>
    16. <div class="aui-form-group clear">
    17. <label class="aui-label-control">
    18. 手机号码 <em>*</em>
    19. </label>
    20. <div class="aui-form-input">
    21. <input style="width:180px; line-height: 30px; padding-left:5px; margin: 8px 0; font-size:16px;" type="text" class="aui-form-control-two" name="youphone" id="2" placeholder="请输入11位的手机号码" onBlur="checkpsd1()" required/>
    22. <span style="margin-left:5px;" id="phone">必须是11位的数字</span>
    23. </div>
    24. </div>
    25. </div>
    26. </form>
    27. </div>
    28. <div style="width:90%; margin: 10px auto;">
    29. <button style="width:100%; line-height:40px; border-radius:10px; height: 40px; background-color: red; font-size:16px; color:#fff; margin:20px 0;">提交</button>
    30. </div>
    31. <br />
    32. </section>
    33. <!-- mask end -->
    34. <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    35. <script type="text/javascript">
    36. //验证姓名
    37. function checkna(){
    38. na=form1.yourname.value;
    39. if( na.length <1 || na.length >6)
    40. {
    41. divname.innerHTML='<font class="tips_false">长度是1~6个字符</font>';
    42. }else{
    43. divname.innerHTML='<font class="tips_true">输入正确</font>';
    44. }
    45. }
    46. //验证手机号码
    47. function checkpsd1(){
    48. na=form1.youphone.value;
    49. if( na.length <11 || na.length >11)
    50. {
    51. phone.innerHTML='<font class="tips_false">必须是11位的数字</font>';
    52. }else{
    53. phone.innerHTML='<font class="tips_true">输入正确</font>';
    54. }
    55. }
    56. //验证社会统一代码
    57. function checkpsd2(){
    58. na=form1.youziz.value;
    59. if( na.length <18 || na.length >18)
    60. {
    61. zizhi.innerHTML='<font class="tips_false">必须是18位社会信用代码</font>';
    62. }else{
    63. zizhi.innerHTML='<font class="tips_true">输入正确</font>';
    64. }
    65. }
    66. </script>