{"action":"opened","issue":{"url":"https://api.github.com/repos/niceue/nice-validator/issues/228","repository_url":"https://api.github.com/repos/niceue/nice-validator","labels_url":"https://api.github.com/repos/niceue/nice-validator/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/niceue/nice-validator/issues/228/comments","events_url":"https://api.github.com/repos/niceue/nice-validator/issues/228/events","html_url":"https://github.com/niceue/nice-validator/issues/228","id":147926102,"number":228,"title":"当input的type设置为number的时候，要对这个input进行是否为数值验证失效","user":{"login":"lxcsmallcity","id":4882651,"avatar_url":"https://avatars.githubusercontent.com/u/4882651?v=3","gravatar_id":"","url":"https://api.github.com/users/lxcsmallcity","html_url":"https://github.com/lxcsmallcity","followers_url":"https://api.github.com/users/lxcsmallcity/followers","following_url":"https://api.github.com/users/lxcsmallcity/following{/other_user}","gists_url":"https://api.github.com/users/lxcsmallcity/gists{/gist_id}","starred_url":"https://api.github.com/users/lxcsmallcity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxcsmallcity/subscriptions","organizations_url":"https://api.github.com/users/lxcsmallcity/orgs","repos_url":"https://api.github.com/users/lxcsmallcity/repos","events_url":"https://api.github.com/users/lxcsmallcity/events{/privacy}","received_events_url":"https://api.github.com/users/lxcsmallcity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-13T02:07:01Z","updated_at":"2016-04-13T02:07:01Z","closed_at":null,"body":"当前脚本的版本信息：\r\n/*! nice Validator 0.8.0\r\n * (c) 2012-2014 Jony Zhang <zj86@live.cn>, MIT Licensed\r\n * http://niceue.com/validator/\r\n */\r\n\r\n问题描述：\r\n当input的type设置为number的时候，要对这个input进行是否为数值验证失效，只能提示\"不能为空\"，如果在这个input输入英文字符的时候，依然提示\"不能为空\"。将input的type改为text验证正常。\r\n为了在移动设备上可以更方便的输入数字(弹出数字键盘)，所以才会将input的type设为number。\r\n测试html代码\r\n`<div class=\"input-group\">\r\n    <span class=\"input-group-addon\" id=\"PayAmount_addon\">数量:</span>\r\n    <input type=\"number\" class=\"form-control\" name=\"PayAmount\" aria-describedby=\"PayAmount_addon\" id=\"PayAmount\" placeholder=\"请输入数量\"  data-rule=\"required;digits\">\r\n</div>`\r\n\r\n测试zh_CN.js配置\r\n`    $.validator.config({\r\n        stopOnError: true,\r\n        //focusCleanup: true,\r\n        theme: 'yellow_top',\r\n        msgStyle: \"float:left;z-index:999\",\r\n        timely: 2,\r\n        defaultMsg: \"{0}格式不正确\",\r\n        loadingMsg: \"正在验证...\",`\r\n\r\n顺便提到一个“msgStyle: \"float:left;z-index:999\",”这个配置，因为我是在bootstrap3.3.6中使用您这个验证插件，并且又用到了input-group这个效果，如果没有加上msgStyle这个配置，会导致验证提示位置不正常。"}}