When I was dynamically populating form values, I found that if the data has a double quote (&qout;) in it, it would cut off the data entered in the form.
To solve this, I found that I could simple Server.HtmlEncode the value and all was well. Except when I was populating from a database and the data was NULL which caused an error for Server.HtmlEncode. So, I whipped up this little function:
Function formEncode(formValue)
Dim m_sOut
m_sOut = formValue
If IsNull(m_sOut) Then
m_sOut = ""
Else
m_sOut = Server.HTMLEncode(m_sOut)
End If
formEncode = m_sOut
End Function
This is used when you assign a value to the form field:
<input type="text" name="example" value="<%=formEncode("The ""test"" is good.") %>">
|