...

View Full Version : Input "CheckBox", some values are encoded



skylab
05-26-2006, 10:53 PM
I have some input checkboxes on a standard HTML form that contain long values. Some of these values must be too long because instead of showing up like this:

<input type="checkbox" name="Standards_1" value="[&lt;A HREF=&quot;#&quot; onClick=&quot;javascript:loadStand('PC.3.220'); return false;&quot;&gt;PC.3.220 - From PC.3.140 Not applicable&lt;/A&gt;]"><A HREF="#" onClick="javascript:loadStand('PC.3.220'); return false;">PC.3.220 - From PC.3.140 Not applicable</A><br>

They show up instead like this one:

<input type="checkbox" name="Standards_1" value="_vbcu42828a92kcf924ch20rre8dm6iorb7kh6kobmc5pm6sj9e1q3kr3fc5i56t31dpi2g9qg8cn36bhi6co2ea9r41p6at3le9 n20pj1dhpmaep27p846bhj5op36c105kg48qb1ctn6usrkd5hi0t35edq6irj741q6u834clq6asjdd5n6a83kd1ii0s31ehkmar jk04m76838clgmot3841hm2sj541n6apb4ecg6isp0e1in4pjfe9mmap1e7gnk2fit_"><A HREF="#" onClick="javascript:loadStand('PC.3.230'); return false;">PC.3.230 - Diagnostic testing to determine the patient’s health care needs is performed.</A><br>

When I use JavaScript to read the "value" of the field I get this encoded text. Very useless I'm afraid.

I guess what I need is either one of two things. I need to either figure out what this encoded text is encoded in and decode it or find some way to read the un-encoded text on the outside of the input value. I've tried to use innerHTML and outerHTML, but it won't grab the unencoded text. Is there another way to grab this text or does anyone know what this encoded text is encoded in and how to use a JavaScript to decode it? :confused:

Any and all suggestions are greatly appreciated. I'm afraid I haven't come across this before and I'm baffled. I've searched around a lot but after several hours of fruitless efforts I thought of my favorite forum for help. Thanks again. :thumbsup:

<<<<TIM>>>>

Arty Effem
05-27-2006, 02:56 AM
I have some input checkboxes on a standard HTML form that contain long values. Some of these values must be too long because instead of showing up like this:

<input type="checkbox" name="Standards_1" value="[&lt;A HREF=&quot;#&quot; onClick=&quot;javascript:loadStand('PC.3.220'); return false;&quot;&gt;PC.3.220 - From PC.3.140 Not applicable&lt;/A&gt;]"><A HREF="#" onClick="javascript:loadStand('PC.3.220'); return false;">PC.3.220 - From PC.3.140 Not applicable</A><br>

They show up instead like this one:

<input type="checkbox" name="Standards_1" value="_vbcu42828a92kcf924ch20rre8dm6iorb7kh6kobmc5pm6sj9e1q3kr3fc5i56t31dpi2g9qg8cn36bhi6co2ea9r41p6at3le9 n20pj1dhpmaep27p846bhj5op36c105kg48qb1ctn6usrkd5hi0t35edq6irj741q6u834clq6asjdd5n6a83kd1ii0s31ehkmar jk04m76838clgmot3841hm2sj541n6apb4ecg6isp0e1in4pjfe9mmap1e7gnk2fit_"><A HREF="#" onClick="javascript:loadStand('PC.3.230'); return false;">PC.3.230 - Diagnostic testing to determine the patient’s health care needs is performed.</A><br>

When I use JavaScript to read the "value" of the field I get this encoded text. Very useless I'm afraid.Then it would be interesting to know how you're doing that reading, as you should be getting:

[<A HREF="#" onClick="javascript:loadStand('PC.3.220'); return false;">PC.3.220 - From PC.3.140 Not applicable</A>]

skylab
05-30-2006, 04:07 PM
The items (examples) I posted were values from the checkbox list of values. Some of the items in the list are encoded, others are not. I'm guessing since the values are longer than a certain length, they must be encoded by the browser. I'm trying to determine what they are encoded in and be able to read them as text and not code. If I ask for the value of the item though all I get is the code, text, or whatever that particular value is in the list.

Any additional thoughts anyone?

Thank you for your views and posts.

<<<<TIM>>>>

skylab
05-31-2006, 07:38 PM
:thumbsup: Ok, folks, listen up. I figured this out. I'm surprised no one has encountered this before.

In HTML, if a value, either for use in a checkbox or radio button has an old-style apostrophe, that's right, an old-style apostrophe ( ’ ) it will convert that value to some encoded value. :rolleyes: Don't ask me how to decode what it is since everything I've tried doesn't work. It must be something specific to the browser session or something. Basically you can't use that apostrophe, instead you either need to change it to a single quote also known as the new apostrophe ( ' ) or change it to it's equivalent HTML ( &_#39; (Minus the "_") ) which will display a new style apostrophe, but the value will keep the HTML.

I've looked everywhere for the html value of the old-style apostrophe ( ’ ), but no luck. I guess it's dead and gone. :o I'm using text from a source that has older style formatting, like this old-style apostrophe, thus I ran into this.

Now you know. ;) No old-style apostrophes in values or they'll be encoded and you won't be able to see the value via javascript without seeing the encoded stuff.

Enjoy!

vwphillips
05-31-2006, 09:56 PM
I've looked everywhere for the html value of the old-style apostrophe ( ’ )

'\u2019'

skylab
01-12-2008, 12:41 AM
I've also found that the double hyphen "–" also makes the value become encoded. Just an FYI I thought I'd pass along to anyone reading this post.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum