<body><form action=function.asp target=_blank method=post>
<select name=opt size=7>
<option value=1 selected>asc(textbox.chr)
<option value=2>chr(textbox.num)
<option value=3>day("31/12/1900")
<option value=4>lcase(textbox.str) ucase(textbox.str)
<option value=5>mid(textbox.str,3,2)
<option value=6>left(textbox.str,3) right3
<option value=7>relace(textbox.str,"A","a")
<option value=8>rnd(textbox.num) randomize
<option value=9>typename(textbox)
<option value=0>soon
</select><input type=text name=textbox value=65>
<input type=submit value=process></form><hr>
<%
dim opt, val, result
opt = request.form("opt")
textbox = request.form("textbox")
if (len(opt) = 0) then opt = 0
select case opt
case 1 : result=asc(textbox)
case 2 : result=chr(textbox)
case 3 : result=day("31/12/1900")
case 4 : result=lcase(textbox)+" - "+ucase(textbox)
case 5 : result=mid(textbox,3,2)
case 6 : result=left(textbox,3)+" - "+right(textbox,3)
case 7 : result=replace(textbox,"A","a")
case 8
randomize
result=rnd(cint(textbox))
case 9 : result=typename(textbox)
case 0 : result="Nothing in textbox"
end select
response.write("[" & result & "]")
%>
</body></html>
จำนวน : 36 บรรทัด