Link to home
Create AccountLog in
Avatar of earwig75

asked on

Need to use URL Encode in CFDiv Tag ColdFusion, receiving error

In the below tag, if the variable in the "bind" has a percent sign/url/special characters in it, it fails. I believe I need to encode/decode the variable thisVarBreaks, can someone assist?

on main page I have:
<cfdiv id="myDiv" bind="url:/site/name/myPage.cfm?myVariable=#thisVarBreaks#"/>

Open in new window

On the myPage.cfm I have:
<cfif someThing neq #URL.thisVarBreaks#>Hello</cfif>

Open in new window

Avatar of _agx_
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Not sure how an extra quote sneaked into the above example, but ... for the archives, the correct code is:

<cfdiv id="myDiv" 

Open in new window