Skip to main content
Inspiring
April 1, 2011
Question

How to escape # in cfdiv binding url variable

  • April 1, 2011
  • 1 reply
  • 663 views

I hav an instance that I have to find out ways to escape the # sign which is contained in the binding variable.

Here is the code:

<form name="myForm" method="post">

<b><center>Part Name</center></b><br>

<select name="Avail_Names" id="Avail_Names">

      <cfoutput query="getName">

            <option value ="#getName.name#"> #name#

     </cfoutput>

</select>

</form>

<cfdiv id="nameDiv" bind="url:desc.cfm?name={Avail_Names}"/>

The result of {Avail_Names} can be anything that with a # in it. ie. AF#SISG, W#JYSM, IEIU#8

Now it works fine for IE, but not in Firefox, it stops at the #, and the rest has been truncated. I need a way to bypass # and pass the whole name.

Please advice.

Thanks.

    This topic has been closed for replies.

    1 reply

    Inspiring
    May 4, 2011

    Try

    <option value ="#URLEncodedFormat(getName.name)#"> #name#

    Make sure you use DecodeURL() when processing the value on a form submit.