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