<input type="text" class="form-control" style="width:80%;" id="username" name="username" placeholder="请输入商户昵称" required pattern="[A-Za-z0-9\u4e00-\u9fa5]{0,25}" title="最大长度为25位" >
<input id="string_confirm_the_registration" type="submit" value="确认注册" style="margin-top: -50px; width: 287px;" onclick="register_user()">
function register() {
var form = $("#form") ;
$.post('user/reg',form.serialize(), function(result){
if(result.code==0){
window.location.href="register_success.html";
}else{
alert(result.msg);
}
}, 'JSON') ;
}
文本框输入错误,只显示result.msg里的内容