add.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=750, initial-scale=1, maximum-scale=1, user-scalable=0" />
  7. <meta name="keywords" content="" />
  8. <meta name="description" content="" />
  9. <title>新增</title>
  10. <!-- FAVICON AND APPLE TOUCH -->
  11. <link href="favicon.ico" rel="shortcut icon" />
  12. <link rel="apple-touch-icon-precomposed" sizes="180x180" />
  13. <meta name="msapplication-TileImage" content="mstile.png" />
  14. <link rel="stylesheet" href="css/common.css" />
  15. <meta name="viewport" content="width=375, user-scalable=no" />
  16. </head>
  17. <body>
  18. <div class="page-wrapper">
  19. <form action="">
  20. <div>
  21. <span><i>*</i>站点名称:</span>
  22. <input type="text" name="siteName">
  23. </div>
  24. <div>
  25. <span><i>*</i>站点位置:</span>
  26. <input type="text" name="siteplace">
  27. </div>
  28. <div>
  29. <span><i>*</i>站点地址:</span>
  30. <input type="text" name="siteAddress">
  31. </div>
  32. <div>
  33. <span><i>*</i>联系人:</span>
  34. <input type="text" name="contactMan">
  35. </div>
  36. <div>
  37. <span><i>*</i>手机号码:</span>
  38. <input type="text" name="mobile">
  39. </div>
  40. <a class="submit-btn">提交</a>
  41. </form>
  42. </div>
  43. <script src="js/layout.js"></script>
  44. <script src="js/jquery-2.2.2.min.js"></script>
  45. <script>
  46. $('.submit-btn').click(function() {
  47. if ($('input[name=siteName]').val().length == 0) {
  48. alert('请输入站点名称')
  49. return false;
  50. }
  51. if ($('input[name=siteplace]').val().length == 0) {
  52. alert('请输入站点位置')
  53. return false;
  54. }
  55. if ($('input[name=siteAddress]').val().length == 0) {
  56. alert('请输入站点地址')
  57. return false;
  58. }
  59. if ($('input[name=contactMan]').val().length == 0) {
  60. alert('请输入联系人')
  61. return false;
  62. }
  63. var mobile = $('input[name=mobile]').val();
  64. if (mobile.length == 0) {
  65. alert('请填写手机号码');
  66. return false;
  67. } else {
  68. var telre = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;
  69. if (!telre.test(mobile)) {
  70. alert('请输入有效的手机号码');
  71. return false;
  72. }
  73. }
  74. })
  75. </script>
  76. </body>
  77. </html>