<script type="text/javascript">
    function ajaxSubmit(url,formId){
        $.ajax({
            url: url,
            data: $(formId).serialize(),
            method: 'POST',
            dataType: 'json',
            success: function(data) {
                if(data.success){
                    $.notify({
                        icon: 'pe-7s-bell',
                        message: data.success

                    },{
                        type: 'success',
                        timer: 10000
                    });
                }else{
                    $.notify({
                        icon: 'pe-7s-bell',
                        message: data.error

                    },{
                        type: 'warning',
                        timer: 10000
                    });
                }
            }
        });
    }
</script>