瀏覽代碼

表耽功能優化

jeter20131220 3 年之前
父節點
當前提交
e62618ff64
共有 5 個文件被更改,包括 74 次插入12 次删除
  1. 24 3
      desktop11/goto.js
  2. 7 7
      desktop11/index.html
  3. 19 1
      desktop11/style.css
  4. 0 0
      desktop11/style.css.map
  5. 24 1
      desktop11/style.scss

+ 24 - 3
desktop11/goto.js

@@ -110,7 +110,7 @@ $(document).ready(function () {
 // phone 格式檢查
 $(document).ready(function () {
 
-  //phone格式檢查
+  // phone格式檢查
 
   $("body").on("change", "#phone", function () {
 
@@ -129,7 +129,7 @@ $(document).ready(function () {
 
   function IsPhone(phone) {
 
-    var regex = /^[0-9]+$/;
+    var regex = /^[09]{2}[0-9]{8}$/;;
 
     if (!regex.test(phone)) {
 
@@ -145,12 +145,26 @@ $(document).ready(function () {
 
 });
 
+
+
+
+
 $(".contact-form1").submit(function (e) {
   /*	var formRef = $('#form1').serializeArray();
     var jsonString = JSON.stringify(formRef);*/
   var jsonInfo = $('.contact-form1').serializeObject();
   var jsonString = JSON.stringify(jsonInfo);
   console.log(jsonString);
+ 
+  // var x=document.forms["myForm"]["loc"].value;
+  // var y=document.forms["myForm"]["h_class"].value;
+  // var z=document.forms["myForm"]["type"].value;
+  // var a=document.forms["myForm"]["budget"].value;
+  // var b=document.forms["myForm"]["style"].value;
+  
+
+
+             
   $.ajax({
     type: 'POST',
     url: 'https://go.hhh.com.tw:8001/deco_request_detail',
@@ -178,11 +192,16 @@ $(".contact-form1").submit(function (e) {
       console.log(JSON.stringify(jqXHR));
       console.log("AJAX errr: " + textStatus + ' : ' + errorThrown);
       console.log('送出失敗: ' + jqXHR.responseText);
+      alert("送出失敗");
     }
   });
-  return true;
+  // return true;
 });
 
+ 
+             
+
+
 
 
 
@@ -318,3 +337,5 @@ function fb_login() {
 }
 
 
+              
+

+ 7 - 7
desktop11/index.html

@@ -326,10 +326,10 @@
 
             <div class="container-fluid" style="padding:0; margin:0;">
                 <form class="contact-form1">
-                    <div id="contact-form">
+                    <div id="contact-form" name="myForm" >
                         <div id="form-left">
-                            <select name="loc" id="location" required>
-                                <option value="地區" disabled selected="selected">地區</option>
+                            <select name="loc" id="loc" required>
+                                <option value="" disabled selected="selected">地區</option>
                                 <option class="option">基隆市</option>
                                 <option class="option">台北市</option>
                                 <option class="option">新北市</option>
@@ -352,7 +352,7 @@
                                 <option class="option">澎湖縣</option>
                             </select>
                             <select name="h_class" id="type" required>
-                                <option value="房屋類型" disabled selected="selected">房屋類型</option>
+                                <option value="" disabled selected="selected">房屋類型</option>
                                 <option class="option">預售屋</option>
                                 <option class="option">中古屋</option>
                                 <option class="option">新成屋</option>
@@ -360,7 +360,7 @@
                                 <option class="option">自地自建</option>
                             </select>
                             <select name="type" id="modal" required>
-                                <option value="房屋型態" disabled selected="selected">房屋型態</option>
+                                <option value="" disabled selected="selected">房屋型態</option>
                                 <option class="option">透天</option>
                                 <option class="option">電梯華廈</option>
                                 <option class="option">公寓</option>
@@ -370,7 +370,7 @@
                                 <option class="option">其他</option>
                             </select>
                             <select name="budget" id="budget" required>
-                                <option value="裝修預算" disabled selected="selected">裝修預算</option>
+                                <option value="" disabled selected="selected">裝修預算</option>
                                 <option class="option">50~100萬</option>
                                 <option class="option">100~200萬</option>
                                 <option class="option">200~300萬</option>
@@ -404,7 +404,7 @@
                                 <option class="option" value="8">8衛</option>
                             </select>
                             <select name="style" id="style" required>
-                                <option value="風格類型" disabled selected="selected">風格類型</option>
+                                <option value="" disabled selected="selected">風格類型</option>
                                 <option class="option">現代風</option>
                                 <option class="option">鄉村風</option>
                                 <option class="option">古典風</option>

+ 19 - 1
desktop11/style.css

@@ -557,7 +557,7 @@ body .arrow:hover {
   top: 19vw;
 }
 
-#contact-us #contact-form #location,
+#contact-us #contact-form #loc,
 #contact-us #contact-form #type,
 #contact-us #contact-form #modal,
 #contact-us #contact-form #budget,
@@ -795,4 +795,22 @@ body .arrow:hover {
     opacity: 1;
   }
 }
+
+form label {
+  display: inline-block;
+  width: 100px;
+}
+
+form div {
+  margin-bottom: 10px;
+}
+
+.error {
+  color: red;
+  margin-left: 5px;
+}
+
+label.error {
+  display: inline;
+}
 /*# sourceMappingURL=style.css.map */

文件差異過大導致無法顯示
+ 0 - 0
desktop11/style.css.map


+ 24 - 1
desktop11/style.scss

@@ -486,7 +486,7 @@ body {
             left: 20vw;
             top: 19vw;
         }
-        #location,
+        #loc,
         #type,
         #modal,
         #budget,
@@ -673,3 +673,26 @@ body {
         }
     }
 }
+
+form label {
+  display: inline-block;
+  width: 100px;
+}
+
+
+form div {
+  margin-bottom: 10px;
+}
+
+
+
+.error {
+  color: red;
+  margin-left: 5px;
+}
+
+
+
+label.error {
+  display: inline;
+}

部分文件因文件數量過多而無法顯示