2014-09-22 3 views
-4

표준 자바 스크립트 확인을 대체하는 jquery 함수를 찾고 있지만 입력 매개 변수 쿠키 이름을 사용할 수 있습니다.이 이름은 확인란을 선택하면 생성되거나 삭제됩니다 팝업에 체크하거나 선택하지 않습니다. 분명히 헤더에 매개 변수가 필요할 것입니다 (확인해주십시오). 묻는 질문간단한 확인 (계속/취소)을 다시 표시하지 않음 확인란을 선택하십시오.

답변

0

어때? http://jsfiddle.net/jakecigar/0x15b5an/2/

function fnOpenNormalDialog() { 
    // Define the Dialog and its properties. 
    $("#dialog-confirm").dialog({ 
     resizable: false, 
     modal: true, 
     title: "Modal", 
     height: 250, 
     width: 400, 
     create: function (e, ui) { 
      var pane = $(this).dialog("widget").find(".ui-dialog-buttonpane") 
      $("<label class='shut-up' ><input type='checkbox'/> Stop asking!</label>").prependTo(pane) 
     }, 
     buttons: { 
      "Yes": function() { 
       $(this).dialog('close'); 
       callback(true); 
      }, 
       "No": function() { 
       $(this).dialog('close'); 
       callback(false); 
      } 
     } 
    }); 
} 

$('#btnOpenDialog').click(fnOpenNormalDialog); 
$(document).on("change", ".shut-up input", function() { 
    alert("shut up! " + this.checked) 
}) 

function callback(value) { 
    if (value) { 
     alert("Confirmed"); 
    } else { 
     alert("Rejected"); 
    } 
} 
관련 문제