/* ===================================================================================

* Theme Name: Airvice Child
* Theme URI: https://bdevs.net/wp/airvice/
* Author: theme_pure
* Author URI: https://themeforest.net/user/theme_pure
* Description: Airvice - AC Repair Services WordPress Theme
* Version: 1.0.0
* Template: airvice
* License: GNU General Public License version 3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Tags: one-column, right-sidebar, left-sidebar, custom-menu, featured-images, post-formats, sticky-post, translation-ready

* We encourage you to create Child theme for any modifications you will want to do.

* Why use Child theme?

* Because of future updates we may provide for this theme that will overwrite your
* modifications and all your custom work.

* If you are not familiar with Child Themes, you can read about it here:
* http://codex.wordpress.org/Child_Themes
* http://wp.tutsplus.com/tutorials/theme-development/child-themes-basics-and-creating-child-themes-in-wordpress/

====================================================================================== */

<script>
document.addEventListener("DOMContentLoaded", function(){

document.getElementById("submitBtn").addEventListener("click", function(){

var name = document.getElementById("name").value;
var phone = document.getElementById("phone").value;
var city = document.getElementById("city").value;
var acType = document.getElementById("acType").value;
var service = document.getElementById("service").value;

if(name === "" || phone === ""){
alert("Please fill required fields");
return;
}

var message =
"New AC Booking\n\n" +
"Name: " + name + "\n" +
"Phone: " + phone + "\n" +
"City: " + city + "\n" +
"AC Type: " + acType + "\n" +
"Service: " + service;

var whatsappNumber = "916356353334";

var url = "https://wa.me/" + whatsappNumber + "?text=" + encodeURIComponent(message);

window.open(url, "_blank");

});

});
</script>