jQuery confirm plugin을 사용합니다.jQuery 확인 대화 상자에서 확인을 클릭하면 양식이 계속 제출됩니다.
다음$(document).ready(function(){
$(".confirm").confirm({
text: "Are you sure?",
title: "Confirmation required",
confirm: function() {
//when I click confirm it will redirect to the link
},
cancel: function() {
//do something
},
confirmButton: "Yes",
cancelButton: "No"
});
});
가 form
입니다 : 내가 "예"버튼을 클릭하면
<form action="submit.php" method="post">
<input type="text" name="username" placeholder="Username">
<button type="submit" class="confirm">Submit</button>
</form>
그래서이 양식을 제출 계속 여기
는 코드입니다.그런데 submit
버튼을 클릭하면 확인 대화 상자가 잘 표시되지만 "예"또는 "아니오"버튼을 클릭해도 아무런 변화가 없습니다.
아마'반환 TRUE '와'확인에 FALSE'반환 및 취소 기능에 대한. – Daan
난 그냥 확인 버튼 $ ("양식"). submit()에 추가하고 괜찮 았지만 정상적인 href를 사용하려고하면 그것은 양식이 아니기 때문에 URL로 리다이렉트하지 않을 것이다. 이 같은 것 Alvinrightback