1. 程式人生 > >jquery-weui兩個輸入框

jquery-weui兩個輸入框

/**
 * Created by wxf on 2017/3/15.
 */
$(document).ready(function () {

});
//<button onclick="alertTwoInput('測試描述','標題','請輸入name','請輸入pass','取消','確定');">測試</button>
function alertTwoInput(text, title, input1, input2, onCancel, onOK) {
    var config;
if (typeof text === 'object') {
        config = text;
} else { config = { text: text, title: title, input1: input1, input2: input2, onOK: onOK, onCancel: onCancel, empty: false //allow empty }; } $.modal({ text: '<p class="weui-prompt-text">' + (config.text || '') + '</p><input type="text" class="weui-input weui-prompt-input" id="weui-prompt-input" value="'
+ (config.input1 || '') + '" />' + '<input type="text" class="weui-input weui-prompt-input" id="weui-prompt-input" value="' + (config.input2 || '') + '" />', title: title, buttons: [{ text: onCancel, className: "primary", onClick: function () { console.log("cancel"
); $.closeModal(); } } , { text: onOK, className: "primary", onClick: function () { console.log("ok"); } } ] }); }