<script type="text/javascript">
$(document).ready(function() {
    $("<%= selector %>").validate({
        rules: <%- JSON.stringify(rule) %>,
        messages: <%- JSON.stringify(message) %>,
        errorPlacement: function(error, element) {
            $(element).addClass('is-invalid');
            $(element).after(error);
        },
        errorClass: "invalid-feedback",
        errorElement: "div",
        highlight: false,
        success: function(element) {
            $(element).prev('input').removeClass('is-invalid');
            $(element).remove();
        },
    });

});

</script>
<script src="/public/js/validate.extend.js"></script>