www.webdeveloper.com
Results 1 to 4 of 4

Thread: Escape # in cfdiv binding variable

  1. #1
    Join Date
    Feb 2010
    Posts
    34

    Escape # in cfdiv binding variable

    Have a problem using cfdiv binding variable, because it contains # in the value, so when it passed in Firefox it truncked anything from # sign on.
    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}"/>

    Not sure what is the way to bypass # in that variable, or I should not use CFDIVE altogether. Appreciate your help.

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    The proper way to escape a # is to prepend it with another # (use # to escape the #.)
    Code:
    <option value ="#REPLACE(getName.name,"#","##","all")#"> #REPLACE(name,"#","##","all")#

  3. #3
    Join Date
    Feb 2010
    Posts
    34
    There is no problem with the selection, it is the cfdiv part{} that prevent to parse all the chars to the next page. Thanks for your reply.

  4. #4
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Quote Originally Posted by jt107 View Post
    There is no problem with the selection, it is the cfdiv part{} that prevent to parse all the chars to the next page. Thanks for your reply.
    Ah.. I see what you're saying. Is there any chance you can change the data so that the '#' is replaced with '%23'?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles