| [點(diǎn)晴永久免費(fèi)OA]JS/ASP代碼只允許輸入數(shù)字英文禁止中文和特殊字符
 Javascript版: function checknumabs(cont){ 	var c = new RegExp(); 	c=/^[\.\-A-Za-z0-9]+$/; 	if(!c.test(cont)){return true;} } if(checknumabs(str)){alert ("只允許使用“.”、“-”、“英文字母”、“數(shù)字”,不允許使用其他任何字符!");} ASP版: function isnaw(tempStr) 	'判斷是否只有字母和數(shù)字和.和- 	isnaw=true 	for temp_no_i=1 to len(tempStr) 		tempStrWord=mid(tempStr,temp_no_i,1) 		AscVal=Asc(tempStrWord) 		if (AscVal<45 or AscVal>46) and (AscVal<48 or AscVal>57) and (AscVal<65 or AscVal>90) and (AscVal<97 or AscVal>122) then 			isnaw=false 			exit for 		end if 	next end function if isnaw(str)=false then htmend("提交失?。褐恢С质褂谩癮-zA-Z0-9.-”,不允許使用中文或其他字符,請(qǐng)修正!") 該文章在 2022/6/7 23:04:31 編輯過(guò) | 關(guān)鍵字查詢 相關(guān)文章 正在查詢... |