Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3. function IsEmpty(){
  4.   if(document.forms['frm'].dienthoai.value.length < 10 || document.forms['frm'].dienthoai.value.length > 13 )
  5.   {
  6.     alert("Bạn chưa điền hoặc sai số điện thoại");
  7.   }
  8.   else if(document.forms['frm'].hoten.value === "")
  9. {
  10.     alert("Bạn chưa điền họ tên");
  11.   }
  12.   else if(document.forms['frm'].diachi.value === "" || document.forms['frm'].diachi.value === "Số:  , đường:  , Phường/Xã:  , Quận/Huyện:  , TP/Tỉnh:")
  13. {
  14.     alert("Bạn chưa điền địa chỉ giao hàng hoặc địa chỉ quá ngắn");
  15.   }
  16.   else
  17.   {
  18.     //return true;
  19.     //$(document).ready(function(){
  20.     //$("#done-btn").on("click", function(e) {
  21.     //  e.preventDefault();
  22.     //  $(".container").addClass("prevent-load");
  23.         // if you want to pass data BACK to ChatFuel,
  24.         // then uncomment this and post the data
  25.         // to broadcast-from-webview.php
  26.        
  27.         $.ajax({
  28.             type: 'POST',
  29.             url: 'broadcast.php',
  30.             data: $('form').serialize(),
  31.             dataType: 'json',
  32.             success: function(data) {
  33.                 MessengerExtensions.requestCloseBrowser();
  34.             }
  35.         });
  36.        
  37.         // If you want to just close the webview,
  38.         // then leave this uncommented
  39.         //MessengerExtensions.requestCloseBrowser();
  40.     //});
  41. //});
  42.   }//return true;
  43. }
  44.  
  45. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement