Hi All,
I have a simple ASP page with a text box and a submit button which displays the text box value on the page when it is submitted after removing all special characters. It works fine in normal cases but fails when the user types the key combination Alt+1 (☺) to Alt+31(▼). For ex: It converts Alt+1 to 9786. I am not sure what is the reason and how to fix this. Please help!
The ASP code:
I have a simple ASP page with a text box and a submit button which displays the text box value on the page when it is submitted after removing all special characters. It works fine in normal cases but fails when the user types the key combination Alt+1 (☺) to Alt+31(▼). For ex: It converts Alt+1 to 9786. I am not sure what is the reason and how to fix this. Please help!
The ASP code:
Code:
<html>
<%
Dim sData
Dim ReplacedString
sData = request("ASCIIData")
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "[^A-Za-z0-9]"
.IgnoreCase = True
.Global = True
End With
ReplacedString = RegularExpressionObject.Replace(sData, " ")
Response.Write "Replaced " & sData & " with " & ReplacedString
Set RegularExpressionObject = nothing
%>
<form id="f1" name="f1" method="post" action="ASCII.asp">
<input name="ASCIIData"/>
<input type="submit" value="submit"/>
</FORM>
</html>
Comment