Input录入控制,只能输入数字(JS代码,FF IE)
<input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
简单的正则 \d 只能输入数字 replace 字符替换
<input onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
简单的正则 \d 只能输入数字 replace 字符替换
<%
'该函数作用:按指定参数格式化显示时间。
'NumFormat=1:将时间转化为yyyy-mm-dd hh:nn格式。
'NumFormat=2:将时间转化为yyyy-mm-dd格式。
'NumFormat=3:将时间转化为hh:nn格式。
'NumFormat=4:将时间转化为yyyy年mm月dd日 hh时nn分格式。
'NumFormat=5:将时间转化为yyyy年mm月dd日格式。
'NumFormat=6:将时间转化为hh时nn分格式。
'NumFormat=7:将时间转化为yyyy年mm月dd日 星期×格式。
'NumFormat=8:将时间转化为yymmdd格式。
'NumFormat=9:将时间转化为mmdd格式。
function FormatDate(LwpCmsDate,NumFormat)
dim YearStr,MonthStr,DayStr,HourStr,MinuteStr '变量含义分别为年字符串,月字符串,日字符串,时字符串,分字符串
if isnull(LwpCmsDate) then
NumFormat=0
else
YearStr=DatePart("yyyy",LwpCmsDate)
if DatePart("m",LwpCmsDate)>9 then
MonthStr=DatePart("m",LwpCmsDate)
else
MonthStr="0"&DatePart("m",LwpCmsDate)
end if
昨天一个客户的网站改点东西.本来很简单的啦.没想在幻灯片那儿卡死了.一般来说幻灯片换个样式百度一下一大堆.不过换上去了毛病却出来了.先是不正常显示.然后接着就是点不了链接.郁闷了好久.后来问我们技术部主管.嘿嘿.一次性解决问题.
先看下.原本的连接是这样:Abcde.asp?mmid=025&lw=025&m2=1&t=245;我把这个链接直接放到地址栏里打开了.再返回去点幻灯片的.可以了.不过只打开了Abcde.asp?mmid=025.我还以为幻灯不支持&这个符号.所以折腾了好久.解决这个其它很简单.转码一下就OK了.![]()
Function vbsEscape(str)
dim i,s,c,a
s=""
For i=1 to Len(str)
c=Mid(str,i,1)
a=ASCW(c)
If (a>=48 and a<=57) or (a>=65 and a<=90) or (a>=97 and a<=122) Then
s = s & c
ElseIf InStr("@*_+-./",c)>0 Then
s = s & c
ElseIf a>0 and a<16 Then
s = s & "%0" & Hex(a)
ElseIf a>=16 and a<256 Then
s = s & "%" & Hex(a)
Else
s = s & "%u" & Hex(a)
End If
Next
vbsEscape = s
End Function
Function vbsUnEscape(str)
dim i,s,c
s=""
For i=1 to Len(str)
c=Mid(str,i,1)
If Mid(str,i,2)="%u" and i<=Len(str)-5 Then
If IsNumeric("&H" & Mid(str,i+2,4)) Then
s = s & CHRW(CInt("&H" & Mid(str,i+2,4)))
i = i+5
Else
s = s & c
End If
ElseIf c="%" and i<=Len(str)-2 Then
If IsNumeric("&H" & Mid(str,i+1,2)) Then
s = s & CHRW(CInt("&H" & Mid(str,i+1,2)))
i = i+2
Else
s = s & c
End If
Else
s = s & c
End If
Next
vbsUnEscape = s
End Function
然后再调用就OK了
最新评论
真是很精彩
第一页打开可以...
我按你的方法去...
Yes, probably so it ...
好,学习了。
不懂恋爱鱼儿!...
实用.我喜欢
多谢.一次性解决...
很好,收藏了
删除后不能发表...