add2.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. <div class="fixed-section">
  20. <div class="nav-tit">
  21. <a class="goBack" onclick="history.back()"></a>
  22. 新增
  23. </div>
  24. </div>
  25. <form action="" style="margin-top:40px">
  26. <div>
  27. <span><i>*</i>站点名称:</span>
  28. <input type="text" name="siteName">
  29. </div>
  30. <div>
  31. <span><i>*</i>站点位置:</span>
  32. <input type="text" name="siteplace">
  33. </div>
  34. <div>
  35. <span><i>*</i>站点地址:</span>
  36. <input type="text" name="siteAddress">
  37. </div>
  38. <div>
  39. <span><i>*</i>联系人:</span>
  40. <input type="text" name="contactMan">
  41. </div>
  42. <div>
  43. <span><i>*</i>手机号码:</span>
  44. <input type="text" name="mobile">
  45. </div>
  46. <a class="submit-btn">提交</a>
  47. </form>
  48. </div>
  49. <script src="js/layout.js"></script>
  50. <script src="js/jquery-2.2.2.min.js"></script>
  51. <script>
  52. $('.submit-btn').click(function() {
  53. if ($('input[name=siteName]').val().length == 0) {
  54. alert('请输入站点名称')
  55. return false;
  56. }
  57. if ($('input[name=siteplace]').val().length == 0) {
  58. alert('请输入站点位置')
  59. return false;
  60. }
  61. if ($('input[name=siteAddress]').val().length == 0) {
  62. alert('请输入站点地址')
  63. return false;
  64. }
  65. if ($('input[name=contactMan]').val().length == 0) {
  66. alert('请输入联系人')
  67. return false;
  68. }
  69. var mobile = $('input[name=mobile]').val();
  70. if (mobile.length == 0) {
  71. alert('请填写手机号码');
  72. return false;
  73. } else {
  74. var telre = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;
  75. if (!telre.test(mobile)) {
  76. alert('请输入有效的手机号码');
  77. return false;
  78. }
  79. }
  80. })
  81. </script>
  82. </body>
  83. </html>