CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Removing apostrophes from input fields - resolved

Print topic Send  topic

Author Message
netsys

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.

Thanks.
View profile  Send private message
netsys

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 http://support.yessoftware.com.

MS Access to Web

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

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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