I have a function to convert HTML code to HTML. It works fine, but for some reason I try to use it in some text today and get the following error:
Microsoft VBScript runtime error '800a000d' Type mismatch: 'UnChkString' /manage/solutions_delete.asp, line 22
I am using this function:
<%= UnChkString(solution_desc) %>
Variable solution_desc :
<p>Here is a description of what this solution is all about.</p>
The field through which the database pulls solution_desc from is a text field.
My UnChkString Function:
Function UnChkString(string) UnChkString = Replace(string,"[%]","%") UnChkString = HTMLDecode(UnChkString) End Function
HTMLDecode Function:
Function HTMLDecode(sText) Dim I sText = Replace(sText, "&" , Chr(38)) sText = Replace(sText, "&" , "&") sText = Replace(sText, """, Chr(34)) sText = Replace(sText, "’", Chr(39)) sText = Replace(sText, "<" , Chr(60)) sText = Replace(sText, ">" , Chr(62)) sText = Replace(sText, " ", Chr(32)) For I = 1 to 255 sText = Replace(sText, "&#" & I & ";", Chr(I)) Next HTMLDecode = sText End Function
EDIT
I even tried:
<%= UnChkString(CStr(solution_desc)) %>
no luck.
James
source share