function.asp

来自「学校部门网站设计,里面有好多模块譬如 简介联系方式 登陆注册留言新闻发布」· ASP 代码 · 共 31 行

ASP
31
字号
<%
function isChecked(srcstr,targetstr)
'返回复/单选框的选择特性。如果输入参数值相等,或者后者包含在前者值内,则返回checked
	dim i,tmpstr
	if instr(srcstr,",")>0 then
	   tmpstr=split(srcstr,",")
       for i=0 to ubound(tmpstr)
          if trim(tmpstr(i))=trim(targetstr) then
             isChecked="checked"
             exit for
          end if
       next
	else
		if trim(srcstr)=trim(targetstr) then isChecked="checked"
	end if
end function

function CheckStr(str)
' 检查sql字符串中是否有单引号,有则进行转化
	dim tstr,l,i,ch
	l=len(str)
	for i=1 to l
		ch=mid(str,i,1)
		if ch="'" then
			tstr=tstr+"'"
		end if
		tstr=tstr+ch
	next
	CheckStr=tstr
end function
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?