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

2015-09-17 20:45:34 +08:00
 doyoucnm

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

1530 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/221558

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX