Skip to content

Commit

Permalink
🚧 add appointment data validation and send data on whatsapp number
Browse files Browse the repository at this point in the history
  • Loading branch information
pank1999 committed Sep 25, 2023
1 parent b3ae494 commit 905423d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 54 deletions.
69 changes: 41 additions & 28 deletions appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,33 +290,37 @@ <h2 class="sec-title_heading">Apply For Appointment</h2>

<!-- Default Form -->
<div class="default-form contact-form">
<div class="row clearfix">

<div class="col-lg-6 col-md-6 col-sm-12 form-group">
<input type="text" name="name" id="name" placeholder="Name" required="">
</div>

<div class="col-lg-6 col-md-6 col-sm-12 form-group">
<input type="text" name="phone" id="phone" placeholder="Phone" required="">
</div>

<div class="col-lg-12 col-md-12 col-sm-12 form-group">
<textarea class="" id="address" name="Address" placeholder="Address"></textarea>
</div>

<div class="col-lg-12 col-md-12 col-sm-12 form-group text-center">
<!-- Button Box -->
<div class="button-box">
<button class="theme-btn btn-style-one" onclick="sendAppointmentDataOnWhatsapp()" >
<span class="btn-wrap">
<span class="text-one">Submit</span>
<span class="text-two">Submit</span>
</span>
</button>
</div>
</div>

</div>
<form id="appointment-form" action="">
<div class="row clearfix">

<div class="col-lg-6 col-md-6 col-sm-12 form-group">
<input type="text" name="name" id="name" placeholder="Name" required="">
</div>

<div class="col-lg-6 col-md-6 col-sm-12 form-group">
<input type="text" name="phone" id="phone" placeholder="Phone" required="">

</div>

<div class="col-lg-12 col-md-12 col-sm-12 form-group">
<textarea class="" id="address" required name="Address" placeholder="Address"></textarea>

</div>

<div class="col-lg-12 col-md-12 col-sm-12 form-group text-center">
<!-- Button Box -->
<div class="button-box">
<button class="theme-btn btn-style-one" onclick="sendAppointmentDataOnWhatsapp()" >
<span class="btn-wrap">
<span class="text-one">Submit</span>
<span class="text-two">Submit</span>
</span>
</button>
</div>
</div>

</div>
</form>
</div>
<!-- End Default Form -->

Expand Down Expand Up @@ -527,7 +531,16 @@ <h4 class="main-footer_title">Contact
</script>
<script>
function sendAppointmentDataOnWhatsapp(){

// appointment validation
//const number = '9636641137';
const name = document.getElementById('name').value;
const phone = document.getElementById('phone').value;
const address = document.getElementById('address').value;
var messageWithUrl = "https://wa.me/9589311150?text="+"Name: "+name+"%0a"+ "Mobile Number: " +phone +"%0a" + "Address : "+address;

if(name.length > 0 && phone.length > 0 && address.length > 0){
window.open(messageWithUrl,'_blank').focus();
}
}
</script>

Expand Down
27 changes: 1 addition & 26 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,32 +962,7 @@
},
});
}
// appointment validation
// if ($("#appointment-form").length) {
// $("#appointment-form").validate({
// rules: {
// username: {
// required: true,
// },
// email: {
// required: true,
// email: true,
// },
// phone: {
// required: true,
// },
// date: {
// required: true,
// },
// subject: {
// required: true,
// },
// message: {
// required: true,
// },
// },
// });
// }


// Scroll to a Specific Div
if ($(".scroll-to-target").length) {
Expand Down

0 comments on commit 905423d

Please sign in to comment.