close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

stop encoding

Thread began 7/29/2009 12:48 am by neo314 | Last modified 7/31/2009 9:29 pm by neo314 | 3488 views | 7 replies |

neo314

stop encoding

I have a dynamic array that produces code like the example below:

WAJA[28][2][0] = '57';
WAJA[28][2][1] = '12|WA|x12|WA| with 7|WA| Sidewalls and a 10|WA| Peak';
WAJA[29] = new Array();
WAJA[29][0] = '1';
WAJA[29][1] = new Array();
WAJA[29][1][0] = '31';
WAJA[29][1][1] = '12|WA|x12|WA| with 6|WA| Sidewalls and a 11½|WA| Peak';
WAJA[29][2] = new Array();
WAJA[29][2][0] = '32';
WAJA[29][2][1] = '12|WA|x16|WA| with 6|WA| Sidewalls and a 11½|WA| Peak';
WAJA[29][3] = new Array();
WAJA[29][3][0] = '40';
WAJA[29][3][1] = '12|WA|x16|WA| with 7|WA| Sidewalls and a 12|WA| Peak';

How can I stop the encoding of the value when it populates the child drop down list so that it comes out 1/2 instead of ½ ?

I can't seem to find where the encoding is coming from.

Sign in to reply to this post

Ray BorduinWebAssist

What is your server language? The encoding is being done when it is written in the server code. You could probably remove it and only encode double quotes.

Sign in to reply to this post
Did this help? Tips are appreciated...

neo314

PHP. I looked but I can't see where the encoding is occurring. I used a single drop down of my own making and it worked fine, but when I made the one long list into a dependent drop down pair using WA_DD this cropped up and the encoding code is not jumping out at me.

Sign in to reply to this post

Ray BorduinWebAssist

Post your server side code from the page and I'll look at it to see where it is added.

Sign in to reply to this post
Did this help? Tips are appreciated...

neo314

Can I send you the file? I would rather not post it for security reasons.

BTW, I think it is occurring client side. At least the dynamic array is not encoded, and the rest should be client side right?

Sign in to reply to this post

Ray BorduinWebAssist

This code is client side:

WAJA[29][1][1] = '12|WA|x12|WA| with 6|WA| Sidewalls and a 11½|WA| Peak';


and you can see the value is already encoded... that means it is probably encoded from the server.

You don't have to include the whole page, just the small section from dynamic dropdowns. It shoudl be standard other than column names and you can change those before posting if you feel more comfortable.

Sign in to reply to this post
Did this help? Tips are appreciated...

neo314

I opened a ticket and he had the same response. I perhaps should have said re-encoded. I changed 0.5 to ½ but it is populating as ½

Tech support is on it. I will post what I find out...

Sign in to reply to this post

neo314

We could not find where this encoding was occuring, but support suggested inserting the actual character instead of the HTML entity. That worked, but could cause encoding problem. Then I found this article.

javascript-how-to-dynamically-create-an-option-that-contains-an-html-entity

It appears that the use of "new Options()" automatically encodes the characters input into the option. The answer is to use unicode escape characters, but then WA DD adds backslashes, so I had to remove the function WA_DD_Replace from the text value and make sure I properly escape the input my function returned.

So instead of ½ I use /u00bd then remove the function WA_DD_Replace from that value. My new function looks like this for javascript functions

function dimFmtList($dim_size) {
if (($dim_size - floor($dim_size)) != 0) {
if (($dim_size - floor($dim_size)) == 0.25) {
$dim_part = "\u00bc\'";
} elseif (($dim_size - floor($dim_size)) == 0.5) {
$dim_part = "\u00bd\'";
} elseif (($dim_size - floor($dim_size)) == 0.75) {
$dim_part = "\u00be\'";
} else {
$dim_part = "\'";
}
} else {
$dim_part = "\'";
}
return floor($dim_size).$dim_part;
}



I used this char table:
www.utf8-chartable.de/

My javascript that populates the drop down now looks like this:

echo "WAJA[".$n."][".$m."] = new Array();\n";
echo "WAJA[".$n."][".$m."][0] = "."'".WA_DD_Replace($row_shedSizes["id"])."'".";\n";
// echo "WAJA[".$n."][".$m."][1] = "."'".WA_DD_Replace(dimFmtList($row_shedSizes["width"])."x".dimFmtList($row_shedSizes["depth"])." with ".dimFmtList($row_shedSizes["sidewall"])." Sidewalls and a ".dimFmtList($row_shedSizes["peak"])." Peak")."'".";\n";
echo "WAJA[".$n."][".$m."][1] = "."'".dimFmtList($row_shedSizes["width"])."x".dimFmtList($row_shedSizes["depth"])." with ".dimFmtList($row_shedSizes["sidewall"])." Sidewalls and a ".dimFmtList($row_shedSizes["peak"])." Peak"."'".";\n";
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...