$(document).ready(function() {

     $(document).on({
        submit: function(e) {
            e.preventDefault();
            e.stopPropagation();
            var eventForm = $('#contactform');
            if (!$(eventForm).find('.form-group.has-error').length) {
                $.ajax({
                    url: "/app/httpreq/form/send_contact",
                    type: 'post',
                    data: $(eventForm).serialize(),
                    dataType: 'script',
                    success: function(responseText) {

                    },
                    error: function(request) {
                        console.log(request.responseText);
                    }
                });
            }

        }
    }, '#contactform');

    if ($("#birthdayPicker").length) {
        $("#birthdayPicker").birthdayPicker({
            "maxAge": 90,
            "minAge": 18
        });

        setTimeout(function() {
            $("#birthdayPicker").find('select').each(function(idx, elem) {
                console.log($(elem).html());
                $(elem).children('option').eq(0).val('');
                $(elem).val('');
                $(elem).prop('required', true);
            });

        }, 100);

    }
});