Home Forums Porto Template Booking Form

This topic contains 1 reply, has 2 voices, and was last updated by  Support2 9 months, 1 week ago. This post has been viewed 268 times

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #10026901


    Kindly assist me. How do I insert the email on the form for delivery of the bookings?



    Hello, thanks for your purchase 🙂

    The Demo Hotel Book Form doesn’t come with a ready server side integration. But you can easily integrate with our default “contact-form.php”. For it, please follow the steps below:

    1) First change the HTML of form to:

    <form id="bookForm" action="php/contact-form-book.php" method="POST">
    	<div class="alert alert-success d-none mt-4" id="formBookSuccess">
    		<strong>Success!</strong> Your book reservation has been sent to us.
    	<div class="alert alert-danger d-none mt-4" id="formBookError">
    		<strong>Error!</strong> There was an error sending your message.
    		<span class="text-1 mt-2 d-block" id="formBookErrorMessage"></span>
    	<div class="row mt-5 mb-5">
    		<div class="col-lg-4">

    * Note that changed action of form and added success and error messages.

    2) Change the JS code of #bookForm at (js/demos/demo-hotel.js) line 126 to:

    	submitHandler: function(form) {
    		var $form = $(form),
    			$messageSuccess = $('#formBookSuccess'),
    			$messageError = $('#formBookError'),
    			$submitButton = $(this.submitButton),
    			$errorMessage = $('#formBookErrorMessage'),
    			submitButtonText = $submitButton.val();
    		$submitButton.val( $submitButton.data('loading-text') ? $submitButton.data('loading-text') : 'Loading...' ).attr('disabled', true);
    		// Ajax Submit
    			type: 'POST',
    			url: $form.attr('action'),
    			data: {
    				arrival: $form.find('#bookNowArrival').val(),
    				departure: $form.find('#bookNowDeparture').val(),
    				adults: $form.find('#bookNowAdults').val(),
    				kids: $form.find('#bookNowKids').val(),
    				room: $form.find('input[name="bookNowRoom"]:checked').val(),
    				fullname: $form.find('#bookNowFullName').val(),
    				address1: $form.find('#bookNowStreetAdd1').val(),
    				address2: $form.find('#bookNowStreetAdd2').val(),
    				city: $form.find('#bookNowCity').val(),
    				state: $form.find('#bookNowState').val(),
    				zip: $form.find('#bookNowZip').val(),
    		}).always(function(data, textStatus, jqXHR) {
    			if (data.response == 'success') {
    				// Reset Form
    				if (($messageSuccess.offset().top - 80) < $(window).scrollTop()) {
    					$('html, body').animate({
    						scrollTop: $messageSuccess.offset().top - 80
    					}, 300);
    				$submitButton.val( submitButtonText ).attr('disabled', false);
    			} else if (data.response == 'error' && typeof data.errorMessage !== 'undefined') {
    			} else {
    			if (($messageError.offset().top - 80) < $(window).scrollTop()) {
    				$('html, body').animate({
    					scrollTop: $messageError.offset().top - 80
    				}, 300);
    			$submitButton.val( submitButtonText ).attr('disabled', false);

    3) Create a new file inside the PHP folder:

    * Configure this file with your email data. Follow the instructions inside the file.

    Please, try that and let us know if you need further assistance.

    Kind Regards,


Viewing 2 posts - 1 through 2 (of 2 total)