简体   繁体   English

引导程序确认(删除点击功能?)

[英]Bootstrap confirmation (remove click function ?)

I've just started to study bootstrap and I'd like to ask a question about it. 我刚刚开始研究引导程序,我想问一个问题。

I'm using "bootstrap confirmation" referenced with URL below. 我正在使用下面的URL引用的“引导程序确认”。 https://github.com/mistic100/Bootstrap-Confirmation/blob/master/example/index.html https://github.com/mistic100/Bootstrap-Confirmation/blob/master/example/index.html

I'm trying to use custom button of bootstrap confirmation and i have a click function for this button as well. 我正在尝试使用引导程序确认的自定义按钮,并且我对此按钮也具有单击功能。

but the problem is when i clicked the button it automatically show confirm box. 但是问题是当我单击按钮时,它会自动显示确认框。 I wanted to show it when i call the function, 我想在调用函数时显示它,

$("#button_id").confirmation("show");

as before I show confirm box i have to check the validation and get the result first... 与之前显示确认框一样,我必须先检查验证并获得结果...

Is there any way to do it? 有什么办法吗? .. ..

ex) 例如)

$("#button_id").confirmation({
          rootSelector: '',
          container: 'body',
          buttons: [
            {
              class: 'class',
              value: 'YES',
              label: 'YES',
              onClick:function(){
              }
            }
          ]
        });

HTML 的HTML

<button id="bt1" class="btn btn-default" >Confirmation 1</button>

JS JS

$("#bt1").click(function() {
  var test = prompt("test");
     if( test == "test"  )
   {
     $('#bt1').confirmation("show");
   }
});

Hope this helps. 希望这可以帮助。 :) :)

function validate() {
    return true;
}

$('#id').click( function() {
    var valid = validate();
    if(valid) {
        $('#id').modal('show');
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM