意见反馈按回退键重新计算

This commit is contained in:
whimlex 2015-04-24 15:08:09 +08:00
parent 091c6125d5
commit 481f7ee4ba
2 changed files with 18 additions and 8 deletions

View File

@ -141,18 +141,18 @@ function cookieget(n)
$(document).ready(function(){
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>=50){
var num=$("#subject").val().substr(0,49);
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(49-$("#subject").val().length)
$("#textCount").text(50-$("#subject").val().length)
}
})
$("#subject").keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>=50){
var num=$("#subject").val().substr(0,49);
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{

View File

@ -116,12 +116,22 @@ $(document).ready(function () {
$(document).ready(function(){
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>=50){
var num=$("#subject").val().substr(0,49);
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length);
$("#textCount").text(50-$("#subject").val().length)
}
})
$("#subject").keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
})
})