继续操作前请注册或者登录。

作者 曹东东

评分

... ... @@ -62,6 +62,19 @@ $("#rate").click(function () {
$(document).on("input",".my_score",function(){
var maxScore = $(this).attr('data-max_score');
var currentScore = $(this).val();
//修复第一个字符是小数点 的情况.
if (currentScore !== '' && currentScore.substr(0, 1) === '.') {
currentScore = "";
}
if(currentScore == '') {
layer.msg("请输入数字", {icon: 1});
$(this).val('');
}
if(isNaN(currentScore)){
layer.msg("请输入数字", {icon: 1});
$(this).val('');
}
if(parseFloat(maxScore) < parseFloat(currentScore)) {
layer.msg("打分区间在0-"+ maxScore+"分之间", {icon: 2});
$(this).val(maxScore);
... ...