Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="transfer_sections">
    <div class="booking_form1">
        <div class="tours_filter tours_booking">
            <h3>FORM</h3>
            <form id="booking_form" action="" method="post">
                <div class="left_section">
                    <h4>Seats</h4>
                    <div class="section1">
                        <span id="seats_msg"></span>
                        <div class="f_group">
                            <label>Adults : </label>
                            <select id="user_adults" name="user_adults">
                                <option value="0">Select Adults</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                            </select>
                        </div>
                        <div class="f_group">
                            <label>Childrens (2 - 11): </label>
                            <select id="user_childrens" name="user_childrens">
                                <option value="0">Select Childrens</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                            </select>
                        </div>
                        <div class="f_group">
                            <label>Infants (0 - 1): </label>
                            <select id="user_infants" name="user_infants">
                                <option value="0">Select Infants</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                            </select>
                        </div>
                    </div>
                    <h4>USER INFORMATION</h4>
                    <div class="section2">
                        <div class="f_group">
                            <label>First Name : </label>
                            <input type="text" name="user_firstname" id="user_firstname">
                            <span id="user_firstname_msg" class="ts_validation_msg"></span>
                        </div>
                        <div class="f_group">
                            <label>Last Name : </label>
                            <input type="text" name="user_lastname" id="user_lastname">
                            <span id="user_lastname_msg" class="ts_validation_msg"></span>
                        </div>
                        <div class="f_group">
                            <label>Email : </label>
                            <input type="email" name="user_email" id="user_email">
                            <span id="user_email_msg" class="ts_validation_msg"></span>
                        </div>
                        <div class="f_group">
                            <label>Phone : </label>
                            <input type="text" name="user_phone" id="user_phone">
                            <span id="user_phone_msg" class="ts_validation_msg"></span>
                        </div>
                        <div class="f_group">
                            <label>Country : </label>
                            <select id="user_country" name="user_country">
                                <option value="">Select Country</option>
                                <option value="India">India</option>
                                <option value="Us">Us</option>
                                <option value="London">London</option>
                            </select>
                            <span id="user_country_msg" class="ts_validation_msg"></span>
                        </div>
                        <div class="terms_group">
                            <label>
                                <input type="checkbox" name="user_terms_conditions" id="user_terms_conditions" value="terms_conditions"> I agree to the conditions and policies belows 
                            </label>
                            <span id="user_terms_conditions_msg"></span>
                        </div>
                        <div class="submit">
                            <input type="submit" id="submit_booking" name="submit_booking" value="SUBMIT">
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
            
          
!
            
              .each_transfer,.show_booking_details,.tours_filter{box-shadow:0 0 20px rgba(0,0,0,.1)}.tours_filter{width:60%;margin:0 auto}.tours_filter form{background:#e5e5e5;padding:20px;float:left;width:100%;box-sizing:border-box}.tours_filter form .f_group{float:left;padding:5px;box-sizing:border-box}.tours_filter form .f_group select{width:100%;float:left;margin-bottom:5px;padding:0 10px;font-size:17px;color:#969696;border:1px solid #d4d4d4;line-height:0;background:#fff;border-radius:0;height:50px;box-sizing:border-box;-webkit-appearance:menulist-button}.tours_filter form .f_group label{width:100%;float:left;margin-bottom:6px;color:#000;font-weight:600;font-size:15px}.tours_filter h3{margin:0;text-align:center;width:100%;float:left;padding:8px;box-sizing:border-box;background:#D9251C;color:#fff;font-weight:500}.tours_filter form .f_group #submit{padding:0;font-size:18px;color:#fff!important;border:0;background:#D9251C;cursor:pointer;height:49px;border-radius:0;width:100%;text-align:center;margin-top:27px}.tours_filter form .f_group:nth-child(1),.tours_filter form .f_group:nth-child(2){width:40%}.tours_filter form .f_group:nth-child(3){width:20%}.booking_dates,.date_row{width:100%;float:left}.date_row{background-color:#fff;border-bottom:1px solid #ececec;padding:10px 20px;box-sizing:border-box;font-size:17px}.date_row .tour_name{width:35%;float:left;padding:5px}.date_row .tour_date,.date_row .tour_seats{width:18%;float:left;text-align:center;padding:5px}.date_row .tour_price{width:9%;float:left;text-align:center;padding:5px}.date_row .tour_action{width:20%;float:left;display:table}.date_row .no_data,.left_section{width:100%;float:left}.book_now{background:#0093f8!important;color:#fff!important}.not_available{background:#D9251C!important;color:#fff!important}.date_row .tour_action a{padding:5px 15px;display:inherit;margin:0 auto;text-align:center}.date_row .tour_name span{padding:2px 7px;border:1px solid #ddd;background:#f2f2f2;border-radius:5px}.date_row .no_data{text-align:center}.blockUI.blockOverlay{background-color:rgba(255,255,255,.5)!important}.blockUI.blockMsg.blockPage{border:0!important;background:0 0!important}.left_section div.f_group{width:50%!important}.section-inputs,.section1,.section2,.section3{width:99%;float:left;padding:10px 0;border-top:1px solid #D9251C;margin-bottom:15px}.left_section h4,.right_section h4{font-size:18px;text-transform:uppercase;width:max-content;margin-bottom:0;background:#D9251C;color:#fff;padding:8px 15px;float:left}.tours_filter form .f_group input{width:100%;float:left;margin-bottom:5px;padding:0 10px;font-size:17px;color:#969696;border:1px solid #d4d4d4;line-height:0;background:#fff;border-radius:0;height:50px;box-sizing:border-box}.section3 div.f_group{width:100%!important}.right_section{float:left;width:35%;padding:0 15px;box-sizing:border-box}.right_section table td:first-child{padding:10px;font-size:15px}.right_section table td:last-child{padding:10px;font-size:15px;font-weight:700}.right_section .section1{background:#fff}.right_section .section1 .f_group{width:100%!important;float:left}.right_section .section1 .f_group input[type=radio],.right_section .section1 .f_group input[type=checkbox]{width:unset;height:unset;margin-right:10px;margin-left:5px}.tours_filter form .f_group input[type=submit]{width:96%;margin:0 2%;background:#0093f8;color:#fff;border:0}.show_terms{width:98%;margin:0 1%;border:1px solid #ddd;float:left;padding:10px}.show_terms ul li{width:93%;float:left;padding:5px 0;list-style:disc;margin-left:7%}span.terms_span{padding:0 5px;border:1px solid #0093f8;border-radius:50%;cursor:pointer}i.custom{border:solid #0093f8;border-width:0 3px 3px 0;display:inline-block;padding:3px;margin-bottom:2px}.arrow.up{transform:rotate(-135deg);-webkit-transform:rotate(-135deg)}.arrow.down{transform:rotate(45deg);-webkit-transform:rotate(45deg)}.ts_validation_msg{text-align:right;float:right;width:fit-content;padding:0 5px;background-color:red;color:#fff;margin-top:-6px}#seats_msg,.body_section,.footer_section,.head_section,.show_booking_details{width:100%;float:left}#seats_msg{color:red;background:#fff;margin-bottom:15px}.head_section{padding:10px 15px;background:#0093f8;color:#fff;font-size:22px}.img_section{width:25%;float:left;padding:15px 7.5px 15px 15px}.details_section{width:75%;float:left;padding:15px 15px 15px 7.5px}.details_section h3{margin-top:0;color:#0093f8;font-weight:800;border-bottom:1px solid #0093f8;width:100%;margin-bottom:15px;float:left}.details_section p{width:100%;float:left;padding:10px 0 0;text-transform:uppercase}.details_section p b{width:25%;float:left;color:#A9A9A9}.details_section p span{width:75%;float:left;color:#303030;font-weight:800}.each_transfer,.each_transfer h3,.transfer{width:100%;float:left}.bprice{font-size:25px;color:#D9251C!important;text-decoration:underline}.each_transfer{background:#fff;margin-bottom:20px}.each_transfer h3{margin:0;text-align:center;padding:8px;box-sizing:border-box;background:#D9251C;color:#fff;font-weight:500}.each_transfer div.text-section{padding:15px;float:left;width:80%}.box-container{display:flex;width:100%;float:left}.each_transfer div.btn-section{padding:15px;float:left;width:20%;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}a.book_now{background:#0093f8!important;color:#fff!important;padding:10px;float:left;width:100%}p.selected_locations{float:left;width:100%;text-align:center;font-size:17px;font-weight:800}.gldp-darkneon,.gldp-default,.gldp-flatwhite,.gldp-googleblue{position:relative!important;font-family:helvetica!important;width:102%!important;margin-top:-28px}.calendar_section,.time_section{margin:7px;float:left;box-sizing:border-box}.core.border.monyear.title{width:70%!important}.core.border{width:14.2857%!important;padding:13px 0 19px!important;line-height:.6!important}.calendar_section{width:31%;background:#fff}.time_section{width:65%}.afternoon,.lunch,.morning{width:33.33%;padding:0 1%;box-sizing:border-box;float:left}button.time_button{width:80%;margin-left:10%;padding:2px;margin-bottom:3px;border:1px solid #fff;background:#fff;cursor:pointer;border-radius:0;font-size:15px;line-height:1.2}button.time_button.selected_time{background:#0093f8;border:1px solid #0093f8;color:#fff}button.time_button:hover{border:1px solid #ddd}.time_section p{text-align:center!important;width:100%}.other_info{width:100%;float:left;display:none;padding:0 1%}.other_info span{float:left;width:50%}.other_info span input{width:fit-content;background:0 0;border:0}.submit,.terms_group{width:100%;float:left}.terms_group{margin-top:25px;font-size:20px}.submit{padding:20px;text-align:center;box-sizing:border-box}.submit input{width:40%;margin:0 2%;background:#0093f8;color:#fff;border:0;padding:2%}.terms_group label{width:100%;float:left;margin-bottom:7px}
@media only screen and (max-width: 600px) {
  .tours_filter{
    width:100%;
  }
}
            
          
!
            
              jQuery(document).ready(function($) {
    //submit booking form
    $("#submit_booking").click(function(e) {
        e.preventDefault();
        var error = 0;

        // Select atleast 1 from 3 field validation
        if ($("#user_adults").val() == "0" && $("#user_childrens").val() == "0" && $("#user_infants").val() == "0") {
            error++;
            $("#user_adults").css("border", "1px solid red");
            $("#user_childrens").css("border", "1px solid red");
            $("#user_infants").css("border", "1px solid red");
            $("#seats_msg").text("Select atleast 1 seat for booking").css("padding", "5px");
        } else {
            $("#user_adults").css("border", "1px solid #d4d4d4");
            $("#user_childrens").css("border", "1px solid #d4d4d4");
            $("#user_infants").css("border", "1px solid #d4d4d4");
            $("#seats_msg").text("").css("padding", "0px");
        }

        // Required validations
        var fields = {
            user_firstname: $("#user_firstname").val(),
            user_lastname: $("#user_lastname").val(),
            user_email: $("#user_email").val(),
            user_phone: $("#user_phone").val(),
            user_country: $("#user_country").val(),
        };

        $.each(fields, function(propName, propVal) {
            if ($("#" + propName).val() == "") {
                error++;
                $("#" + propName + "_msg").text("Required");
            } else {
                $("#" + propName + "_msg").text("");
            }
        });

        // checkbox validation terms and conditions
        if (!($('#user_terms_conditions').is(':checked'))) {
            error++;
            $("#user_terms_conditions_msg").text("Please select terms and conditions before booking").css({"color": "red", "text-align": "right", "width": "100%"});
        } else {
            $("#user_terms_conditions_msg").text("");
        }

        // after all validations are done form will be ready to submit
        if (error == 0) {
            alert("Form ready to submit");
            // here you can submit form
        }
    });
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console