我正在使用警报,这很好,但我有一个小问题我想解决,也许在您的帮助下。
使用提示组件,我想强迫用户在输入字段中写一个“原因”,老实说,我不知道怎么做.
实际上我的代码是这样的:
alertify.prompt(
'Warning!',
'Are you sure you wish to CANCEL the order?',
'Enter reason please...',
function (e, reason) {
// my code on confirm...
},
function () {
return;
}
);希望你能帮上忙。
发布于 2016-01-22 16:09:23
这些文件显示如下:
alertify.prompt(
'Warning!',
'Are you sure you wish to CANCEL the order?',
'Enter reason please...',
function (e, reason) {
if( reason == '' ) {
e.cancel = true;
}
// my code on confirm...
},
function () {
return;
}
);若要防止对话框关闭,请设置http://alertifyjs.com/prompt/onok.html = closeEvent.cancel = true或使回调返回false。
https://stackoverflow.com/questions/34950801
复制相似问题