日期:2014-05-17 浏览次数:20687 次
<tr><td width="14%" class="font_b1" id="Content_Sms"> <div> 短信: </div> </td> <td width="86%" align="left" colspan="3"> <input class="tx" name="affairs.ContentSms" size="101" maxlength="101" onkeyup="javascript:checkPname(this);"/> <span class="check_pname"></span> </td> </tr>
//长度判断 function checkPname(obj){ var message = ""; var length = obj.value.length-1; if(length>=200 && obj.className=="pname" ){ message="<font style='color: red; font-size: 12px; font-weight: bold;'>已达到最大"+length+"字符的限制</font>"; $(obj).next(".check_pname").css("display","block"); $(obj).next(".check_pname").html(message); }else if(length>=32 && obj.className=="Type"){ message="<font style='color: red; font-size: 12px; font-weight: bold;'>已达到最大"+length+"字符的限制</font>"; $(obj).next(".check_pname").css("display","block"); $(obj).next(".check_pname").html(message); }else if(length>=100 && obj.className=="tx"){ message="<font style='color: red; font-size: 12px; font-weight: bold;'>已达到最大"+length+"字符的限制</font>"; $(obj).next(".check_pname").css("display","block"); $(obj).next(".check_pname").html(message); }else if(length==0 && obj.className=="pname"){ $(obj).next(".check_pname").css("display","inline"); }else{ $(obj).next(".check_pname").css("display","none"); } }