doyoucnm
V2EX  ›  问与答

AJAX 提交表单同一个手机注册多个账号问题

  •  
  •   doyoucnm · Sep 17, 2015 · 2267 views
    This topic created in 3973 days ago, the information mentioned may be changed or developed.

    // 提交表单
    $('#btn-confirm-login').on ('click', function (){
    $('#form-to-post').ajaxSubmit ({
    beforeSubmit: function (){
    if ($('#input-account').val ().length == 0 ) {
    ui.error ("请输入帐号");
    $('#input-account').focus ();
    return false;
    }
    if ($('#input-password').val ().length == 0 ) {
    ui.error ("请输入密码");
    $('#pinput-password').focus ();
    return false;
    }
    return true;
    },
    success: function (i ){
    $('#error-msg-tip').html ('<p>'+i.info+'</p>').show ();
    if (i.status == 1 ){
    if (i.data == 0 ){
    window.location.href = U ('public/Index/index');

    }else{
    window.location.href = i.data;

    }
    }else if (i.status == 2 ){
    var membs = i.data;
    // console.log (membs );
    var $con = $('#select-sub-acc');
    $con.empty ();
    $.each (membs, function (i, e ){
    var $btn = $("<button></button>");
    $btn.text (e.uname ).data ("acc", e.worket ).data ('uid', e.uid );
    $btn.on ('click', function (){
    //var worket = $(this ).data ('acc');
    var uid = $(this ).data ('uid');
    $('#hidden-uid').val (uid );
    //$('#input-account').val (worket );
    $('#btn-confirm-login').trigger ('click');
    });
    $con.append ($btn );
    });

    var $dialog = $('#select-sub-acc').dialog ({
                            autoOpen: false,
                            height: 200,
                            width: 300,
                            modal: true,
                            title:"请确定一个帐号"
                        });
                        $dialog.dialog ('open');
                    }
                },
                dataType: 'json'
            }); 
            return true; 
        }); 
        //var j17 = $.noConflict ();
    
    当同一个手机注册多个账号时,会提醒用哪个账户登录,比如说这里,
    显示的是 uname 不同的人名。
    
    如果要改为 人名(身份)学校 这样显示,
    其中 学校和人名在同一张表,身份在另一张表,
    请问该怎么写?还有身份这个括号该怎么写?
    

    这里主要用的是 ajax , jquery, jquery form 。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   917 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:29 · PVG 05:29 · LAX 14:29 · JFK 17:29
    ♥ Do have faith in what you're doing.