Saturday, June 04, 2005

Coldfusion Stripping Out Special Characters

I have variables being passed through a URL and automatically populated in form fields in a CFM page. However, when the variable value has a quotation mark it won't populate the field properly... I expect it is because the quotation is forcing the value="" attribute in the form to terminate prematurely.

How can I strip special characters from CF variables as they are passed to the CF template?

<input type="MyField" value="#URLEncodedFormat(URL.VarA)#">

If that doesn't work... <input type="MyField" value="#Replace(URL.VarA,Chr(34),""e;","ALL")#">

0 Comments:

Post a Comment

<< Home