jwdcfdeveloper
Programmer
I need a way to keep single quotes in a form field without blowing up when the value is passed to an Oracle database. Here is an example:
'#trim(evaluate("form.stringValue_"&i))#'.
The value is part of a loop of dynamically generated form names. I use another loop to get the "i" value to make the stringValue value dynamic. However, I have found that if someone adds a single quote in the stringValue (i.e. stringValue = "We're great"), the stringValue causes errors, because it thinks that the single quote between "We" and "re" is another value, and gives me a missing comma error. I tried adding PerserveSingleQuotes:
(e.g. #PreserveSingleQuotes(trim(evaluate("form.stringValue_"&i)))#),
but CF does not like that with this type of string. Anyone have any ideas how I can keep the single quotes in the stringValue variable?
'#trim(evaluate("form.stringValue_"&i))#'.
The value is part of a loop of dynamically generated form names. I use another loop to get the "i" value to make the stringValue value dynamic. However, I have found that if someone adds a single quote in the stringValue (i.e. stringValue = "We're great"), the stringValue causes errors, because it thinks that the single quote between "We" and "re" is another value, and gives me a missing comma error. I tried adding PerserveSingleQuotes:
(e.g. #PreserveSingleQuotes(trim(evaluate("form.stringValue_"&i)))#),
but CF does not like that with this type of string. Anyone have any ideas how I can keep the single quotes in the stringValue variable?