Web Analytics Made Easy -
StatCounter " and " --> not going into option boxes corrrectly..please advise - CodingForum


No announcement yet.

" and " --> not going into option boxes corrrectly..please advise

  • Filter
  • Time
  • Show
Clear All
new posts

  • " and " --> not going into option boxes corrrectly..please advise


    I am getting data from the "app layer" and its returning thru a plugin that converts certain characters as their HTML equivalents....such as:

    ' is coming thru as "

    now, I am doing pattern matching on some dropdowns...

    so for example, a dropdown value would be:

    This " IS " a cool game

    but it shows thru the page as:
    This "IS" is a cool game

    the problem is, in the javascript arrays I have..I have the encoded versions...but the "text" values for the dropdowns are - This "IS" is a cool game --> so they don't match...PLUS, when I can get the array value to show, it shows in the dropdown as:

    This " IS " a cool game

    its not HTML-atized as it is onload....weird??????

  • #2
    The html entities you typed must have been rendered by the browser but I saw your point. Can you post some codes? To properly type entities in your post, you must make the & symbol as entity also. i.e. " will display "
    vBulletin Mods That Rock!


    • #3

      here is what the select box looks like onLoad..
      keep in mind, that the initial display DOES LOOK correct even the the option.text value has html characters sets....ala..

      <select NAME="quotes" onChange="storenameVal(this.options[this.selectedIndex].text);"> <OPTION VALUE="">Quote 1</OPTION>
      <OPTION VALUE="">I &quot;SEE&quot; &amp; hear you </OPTION>

      in the array it shows..

      var quotes = new Array("I &quot;SEE&quot; &amp; hear you")

      but when I try to match them when a user selects that option...it doesn't match...
      I take the option TEXT value --> but that is this: I "SEE" & hear you

      even though in the code it looks like what is shown above...so the option TEXT is trying to match..

      I "SEE" & hear you
      I &quot;SEE&quot; &amp; hear you

      and it doesn't work.

      SO - how do I translate it out before the match? Is there something like the "encode" method in js for this?

      I keep trying to edit this...but my HTML character set for quotes and ampersands are showing up 'normal'.....so?
      Last edited by BrightNail; Feb 26, 2004, 06:03 PM.


      • #4
        As I said in my previous post, you must encode the ampersand symbol to correctly display html entities.

        To correctly display &amp;amp; type &amp;amp;amp;
        and to display &amp;quot; type &amp;amp;quot;

        Try editing your post again.
        vBulletin Mods That Rock!