2016-08-17 1 views
3

이메일 주소의 유효성을 검사하기 위해 sweetalert2를 사용하고 있지만 이름을 입력하기 위해 텍스트 입력을 표시하고 싶습니다. 나는 그것이 체인 모달이라고 이해하지만, 나는 내 삶에 대해 어떻게 페이지에서 주어진 예제로부터 운동을 할 수 없습니까?sweetalert2 모달 연결하기

var cloud_email = $('.cloud_email').text(); 
var user_name = $('.user_name').text();; 
swal.setDefaults({ 
    confirmButtonText: 'Next →', 
    showCancelButton: true, 
    animation: false 
}); 

var steps = [ 
    { 
    //ask for and validate email here 
    type: 'question', 
    title: 'Please enter email address', 
    input: 'email', 
    inputValue: cloud_email 
    }, 
    { 
    //ask for and validate text input here 
    type: 'question', 
    title: 'Please enter user name', 
    input: 'text', 
    inputValue: user_name 
    } 
]; 

swal.queue(steps).then(function(email, name) { 
    swal({ 
    type: 'success', 
    html: 'Email successfully sent to: ' + name + ': '+ email 
    }); 
}).finally(function() { 
    swal.resetDefaults(); 
    //ajax to process values passed 
}) 

내 시도 반환이 오류 :

swal.queue(...).then(...).finally is not a function 

답변

관련 문제