日期:2014-05-16 浏览次数:20545 次
<td noWrap width="20%"> <div> <textarea id="msgContentArea" rows="15" cols="40" onPropertyChange="javascript:setMsg();"></textarea> <span><font color="red">*</font></span> </div> </td> <th><app:i18n key="page.9.wordcount"/>:</th> <td colspan="2"> <font color="red"><app:SmsContextTag form="PolicyFormBean" formfield="msgPreview" /> </font> </td>
function setMsg(){ //获取短信内容和签名状态 var previewMsg = ""; var msgContentArea=$("#msgContentArea"); previewMsg += msgContentArea.val(); var nameFlagObjs = document.getElementsByName("nameFlag"); var nameFlag = false; var userName = ""; if(nameFlagObjs[1].checked){ nameFlag = true; userName = document.getElementsByName("currentName")[0].value; } if(nameFlag) previewMsg += "[" + userName + "]"; if(msgContentArea.val()=="") previewMsg = ""; [color=#FF0000]PolicyFormBean.msgPreview.value[/color] = previewMsg; }
System.out.println(longsmsenglishlength); System.out.println(longsmschineselength); StringBuffer sb = new StringBuffer(); sb.append("<script language=\"javascript\">\n"); sb.append("var submitflag = false;\n"); sb.append("function checkSmsContext(send_content){\n"); //sb.append("alert(send_content);"); sb.append("var strlength=0;\n"); sb.append("var iList=0;\n"); sb.append("var maxlengths=134;\n"); sb.append("var firstmax=140;\n"); sb.append("send_content = send_content.replaceAll('\\r','');\n"); //sb.append("alert(send_content);"); sb.append("if( isChinese( send_content ) ){\n"); sb.append("firstmax=140;\n"); sb.append("strlength = send_content.length * 2;\n"); sb.append("}else{\n"); sb.append("firstmax=140;\n"); sb.append("strlength = send_content.length;\n"); sb.append("} \n"); sb.append("if( strlength<=firstmax ){\n"); sb.append("iList=1;"); sb.append("}else{\n"); sb.append("if( strlength%maxlengths==0 ){\n"); sb.append("iList = parseInt( strlength/maxlengths );\n"); sb.append("}else{\n"); sb.append("iList = parseInt( strlength/maxlengths ) + 1;\n"); sb.append("}\n"); sb.append("}\n"); sb.append("if(strlength >800){\n"); sb.append("submitflag=false;}\n"); sb.append("else{\n"); sb.append("submitflag=true;\n"); sb.append("}\n"); sb.append("document.getElementsByName(\"