白葡萄酒配什么零食:if dname="" or len(dname)>20 then
来源:百度文库 编辑:高考问答 时间:2024/07/08 10:20:49
if dname="" or len(dname)>20 then
founderr="true"
errmsg="<li>年级名不能为空且在20个字符以内"
有这么一段话,但是当我在dname中输入的是汉字,errmsg这个就无效,但是输入的是字母就有效,是不是还需要用类似cina来转换?应该用什么转换???
founderr="true"
errmsg="<li>年级名不能为空且在20个字符以内"
有这么一段话,但是当我在dname中输入的是汉字,errmsg这个就无效,但是输入的是字母就有效,是不是还需要用类似cina来转换?应该用什么转换???
最简单的解决办法是把输入框设定maxlength=20,这样他无论输入汉字还是英文都不可能超过20。
如果你嫌这样解决的不彻底,可以做一个函数来代替len不能区分汉字和英文,示例如下:
<%
Function CheckStringLength(txt)
txt=trim(txt)
x = len(txt)
y = 0
for ii = 1 to x
if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then '如果是汉字
y = y + 2
else
y = y + 1
end if
next
CheckStringLength = y
End Function
%>
if dname="" or len(dname)>20 then
急!有关 if session="" then end if
EXCEL函数:IF(A1=S,"10",IF(A1=ST,"20"))
EXCEL函数:IF(A1=SS,"10",IF(A1=ST,"20"))
excel中的函数=IF(A1="S??","1500",IF(A1="t??","2000"))
if ($_GET['action'] == "editfile"){
if "<"=mywords.substring(i,1)
IF user_name=Request.Cookies("useInfo")("user_name") 是什么意思
if rs("username")=session("Current_user") then 问题,几天了
<%if rs("cpjg")="0" then response.write"价优" else response.write""&rs("cpjg")&"元" end if%>