CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> ASP

 Removing apostrophes from input fields - resolved

Print topic Send  topic

Author Message

Posts: 39
Posted: 07/20/2010, 11:55 AM

I've got some input fields that can have apostrophes in them, and when I try to use this data in a string, I get errors.

I found a reference to replacing them by doing this:

<%function cleanInput(byval str)
str = str & ""
str = trim(replace(str, "'", "''"))
cleanInput = str
end function%>

How can I implement something like this in CodeCharge? I would assume this would be in the before insert or before update function of the page with the inputs, but I can't seem to find any examples of how to implement this.

View profile  Send private message

Posts: 39
Posted: 07/20/2010, 12:41 PM

Actually, figured out a different way to do this. When pulling the data into a variable for use, I just cleaned it there. Example:

Dim varClassType
varClassType = Session("classtypesession")
varClassType = Replace(varClassType,"'","''")

Seems to work okay.
View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.