How to delay form submission of a form which has empty field checks

I have a form with empty field checks and been trying to delay the form submission after the field checks are done unsuccessfully. The below code is for 2 fields only(there are 7 fields).

The field check code is:

<script type="text/javascript">

function FrontPage_Form3_Validator(theForm)
{

  if (theForm.First_Name.value == "")
  {
    alert("Please enter a value for the "First Name" field.");
    theForm.First_Name.focus();
    return (false);
  }

  if (theForm.Last_Name.value == "")
  {
    alert("Please enter a value for the "Last Name" field.");
    theForm.Last_Name.focus();
    return (false);
  }



  return (true);

}
</script>

The form code is:

<form method="POST" action="https://example.com" onsubmit="return FrontPage_Form3_Validator(this);" name="FrontPage_Form3" id="detailsphp" autocomplete="on">

<input class="textlinesubmit" type="text" name="First_Name" tabindex="1">
<input class="textlinesubmit" type="text" name="Last_Name" tabindex="2">

<input id="submitbutton" class="updatemyordersubmitbutton" type="submit" value="Submit Order" name="B1" tabindex="13" style="width:110px;font-family:arial;height:30px;" onclick="sometrackevent;">

</form>

I just can’t figure out how to keep the empty field check and then delay the form submission.

What I have tried:

  1. I put a setTimeout around the FrontPage_Form3_Validator function outside of the function and inside of the function but of course this delays the function hence the form just submits without any empty field checks. I even tried to put a setTimeout just around the return (true); like so:
setTimeout(function() {
   return (true);
}, 5000);

But I guess this is not even valid in javascript.

I tried to change the input submit to input button like below but that doesn’t even fire the FrontPage_Form3_Validator function:

<input id="submitbutton" class="updatemyordersubmitbutton" type="button" value="Submit Order" name="B1" tabindex="13" style="width:110px;font-family:arial;height:30px;" onclick="FrontPage_Form3_Validator(theForm);sometrackevent;">

or:

<input id="submitbutton" class="updatemyordersubmitbutton" type="button" value="Submit Order" name="B1" tabindex="13" style="width:110px;font-family:arial;height:30px;" onclick="FrontPage_Form3_Validator();sometrackevent;">

To maybe late do something like this:

function mysubmitForm() {
document.getElementById("detailsphp").submit()
}
setTimeout(mysubmitForm, 5000); 

I also tried to change the form code to:

<form method="POST" action="https://example.com" onsubmit="window.setTimeout(function () { return FrontPage_Form3_Validator(this); }, 2000)" name="FrontPage_Form3" id="detailsphp" autocomplete="on">

or:

<form method="POST" action="https://example.com" onsubmit="window.setTimeout(function () { FrontPage_Form3_Validator(this); }, 2000)" name="FrontPage_Form3" id="detailsphp" autocomplete="on">

or:

<form method="POST" action="https://example.com" onsubmit="window.setTimeout(function () { FrontPage_Form3_Validator(); }, 2000)" name="FrontPage_Form3" id="detailsphp" autocomplete="on">

But all of the above doesn’t work.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật