Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Strip Double Quotes

Posted 27 Oct 2004 16:26:17
1
has voted
27 Oct 2004 16:26:17 Erik Piisila posted:
I have a simple form with a multiline text box. Inevitably someone decides to use double quotes. On form submit, I display the message to a preview page then write to a database.

I've tried

<% dim strMessage
strMessage=Request("message"
strMessage=Server.HTMLEncode(strMessage)
strmessage= Replace(strmessage, vbCrLf, "<BR>"
%>

I've tried
<% dim strMessage
strMessage=Request("message"
strMessage=Replace(strMessage, chr(34), "'"
strmessage= Replace(strmessage, vbCrLf, "<BR>"
%>

Each time the message ends where the first instance of " happens.

Please help. What replace function can I used for double quotes?

Replies

Replied 01 Nov 2004 16:54:59
01 Nov 2004 16:54:59 Lee Diggins replied:
Hi EriK

You could try something like:

strmessage = Replace(strmessage, """", "'"

This example replaces the double quote with a single quote.

Digga

Sharing Knowledge Saves Valuable Time!!!

Reply to this topic