1

PartialView での JS の確認に問題があります。以下のコードは、ページが PartialView でない場合は正常に動作しますが、ページが PartialView の場合、その確認ダイアログで [OK] をクリックしても閉じません。なんで ?

$("input.del-file-cb").live('click',function () {
      if ($(this).is(':checked')) {
          var ans = confirm('Are You sure ?');

          if (ans) {
                   ....             
          } else {
                 $(this).attr("checked", false);
          }
      }
 });

編集

それは二重の確認のようです...

4

1 に答える 1

1

ソリューション:

$("input.del-file-cb").live('click',function (e) {
      if ($(this).is(':checked')) {
         e.preventDefault();

... the rest of the code ...
于 2012-08-01T15:31:26.037 に答える