使用layer.open 父頁面獲取子頁面輸入文本框中的值


$(function () {
        $("#confirmpassword").click(function () {

            var pwd = $("#txtPwd").val();
            layer.open({
                type: 1
                , title: '請輸入登入密碼'
                , closeBtn: false
                , area: '350px;'
                , shade: 0.8
                , id: 'LAY_layuipro' //設定一個id,防止重復彈出
                , btn: ['保存','關閉']
                , btnAlign: 'c'
                , moveType: 1 //拖拽模式,0或者1
                , content:'<div style="padding: 30px 20px;; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">密碼:<input id="firstpwd" type="password" placeholder="請輸入密碼"></div>'//彈出的子頁面
                , yes: function (index, layero) {
//獲取輸入框內容
var oldPass=layero.find('#firstpwd'); var pass = $(oldPass).val(); var pwd = $("#txtPwd").val(); //var jmpwd = hex_md5(pass).toUpperCase();//這是MD5加密 alert(pwd); alert(pass); alert(jmpwd); if (pwd == jmpwd) { myfunction(); } else { alert("密碼錯誤"); } layer.close(index); }, cancel: function (index) { layer.close(index); } }); }); });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM