zoukankan      html  css  js  c++  java
  • 使用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); } }); }); });
  • 相关阅读:
    设计模式来替代if-else
    Cloneable接口的作用与深度克隆与浅度克隆
    IP地址分类
    MIME-TYPE
    Linux curl
    Cookie 跨域???
    冒烟测试
    @Valid、@Validated 、正则验证工具
    Node.js—第一个动态页面
    Node.js—小试牛刀-创建目录
  • 原文地址:https://www.cnblogs.com/hudean/p/11676529.html
Copyright © 2011-2022 走看看