0

我正在编写验证代码,如果发生任何错误,请确认或出现警告对话框。现在我想在警报对话框中保留一个复选框,如果选中该复选框,则应该返回复选框上的值。我尝试使用 jquery-modal 对话框,但它没有帮助我。所以谁能告诉我我该怎么做

4

2 回答 2

0

Jquery modal 为您完成了这项工作。

下面是设置关闭复选框值的代码。

http://jsfiddle.net/RSk4v/

 $(function () {
 $("#dialog-confirm").dialog({
     resizable: true,
     height: 150,
     modal: true,
     close: function () {
         $(this).find(':checked').each(function () {
             var name = $(this).attr('name');
             $('input[name="' + name + '"]').val('checked '+name);
         });
     },
     buttons: {
         "Ok": function () {
             $(this).dialog("close");
         },
         Cancel: function () {
             $(this).dialog("close");
         }
     }
 });
 });
于 2013-06-12T06:53:05.420 回答
0

如果我理解你的问题,我会做这个练习。

对于复选框上的控件,您必须使用此脚本:

  if(document.getElementById("check1").checked=true)

演示

于 2013-06-12T07:19:36.550 回答