V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
doyoucnm
V2EX  ›  问与答

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

  •  
  •   doyoucnm · 2015-09-17 20:45:34 +08:00 · 1515 次点击
    这是一个创建于 3189 天前的主题,其中的信息可能已经有所发展或是发生改变。

    // 提交表单
    $('#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 。

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2071 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:10 · PVG 00:10 · LAX 09:10 · JFK 12:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.