function | text box
A good and useful function! I hope it works for you.
<%
Function Requesttext (Textstring,texttype,textname,textnumbermost,textnumberleast)
' TextString gets the value in the text box
' Texttype set the type of text box name, such as input for 0,textarea 1
' Textname the name displayed when the error is encountered
' Textnumbermost text box can fill in the maximum number of bytes
' Textnumberleast text box can fill in the minimum number of bytes
Gettext=request (TextString)
Select Case Texttype
Case 0
Gettext=replace (GetText, "<", "<")
Gettext=replace (GetText, ">", ">")
Gettext=replace (GetText, "'", "" ")
If Len (GetText) >textnumbermost Then
Response.Write ("<script>alert" you enter a byte in the &TextName& entry exceeds the maximum byte "&TextNumberMost&", please return to re-enter! ""); History.go ( -1) </script> ")
Response.End
Elseif Len (GetText) <textnumberleast Then
Response.Write ("<script>alert" you enter a byte less than the minimum byte "&TextNumberLeast&" in the "&TextName&" entry, please return to re-enter! ""); History.go ( -1) </script> ")
Response.End
End If
Case 1
Gettext=replace (GetText, "<", "<")
Gettext=replace (GetText, ">", ">")
Gettext=replace (GetText, "'", "" ")
Gettext=replace (GetText, "", "")
Gettext=replace (Gettext,vbcrlf, "<br/>")
If Len (GetText) >textnumbermost Then
Response.Write ("<script>alert" you enter a byte in the &TextName& entry exceeds the maximum byte "&TextNumberMost&", please return to re-enter! ""); History.go ( -1) </script> ")
Response.End
Elseif Len (GetText) <textnumberleast Then
Response.Write ("<script>alert" you enter a byte less than the minimum byte "&TextNumberLeast&" in the "&TextName&" entry, please return to re-enter! ""); History.go ( -1) </script> ")
Response.End
End If
End Select
Requesttext=gettext
End Function
%>
<%
' Example
If Request ("post") <> "then
Name=requesttext ("name", 0, "name", 10,2)
Text=requesttext ("text", 0, "content", 255,0)
Response.Write "Name value is:" &Name& "<br> content value is:" &text
End If
%>
<form method= "Get" >
<p> name <input type= "text" name= "name" size= "></p>
<p> content <textarea rows= "6" name= "text" cols= "></textarea><input type=" Submit "value=" submitted "Name=" Post ">
<input type= "reset" value= "reset" name= "B2" ></p>
</form>