ajax request in sweet alert

Posted 5 months ago by mDelshad

I show to user a sweet alert after sending the activation code...This sweet alert has an input that the user must enter received code and send in the ajax request, how i can do this?

swal({
                        title: 'enter confirmation code',
                        input: 'text',
                        inputPlaceholder: 'confirmation code',
                        showCancelButton: true,
                        inputClass: 'form-control',
                        inputValidator: function (value) {
                            return !value && 'You need to write something!'
                        }
                    }).then(function (result) {
                        if (result.value) {
                            swal({
                                type: 'success',
                                html: 'code, ' + result.value
                            });
                        }
                    });

Please sign in or create an account to participate in this conversation.