JSFiddle - React, Tailwind, and code Playground

by MrTest

JavaScript

$(document).ready( function(){

/* ContactForm Validation */
if ($(".contact-form-wrapper").length > 0) {
    $("#contact-form").validate({
        validClass: "error",
        validClass: "success",
        rules: {
            name: "required",
            surname: "required",
            email: {
                required: true,
                email: true
            },
            phone: {
                required: true,
                minlength: 10


            },
            enquiry: {
                required: true,
                minlength: 5
            }
        },
        submitHandler: function() {

            var ContactName = $('#contact-name').val();

            $.get("contact-form.php", {
                ContactName: ContactName

            }, function() {}).success(function() {

                $('.contact-form-wrapper').fadeOut(100);
                $('.thank-you-wrapper').fadeIn(100);



                return false;
            })
        }
    });

}

});