I have a textarea on a page which contains notes as text. Html encoded
entities are encoded correctly for display in order to pass XHTML 1.0
strict validation (which is a company requirement).

E.G.

<textarea name="listing_summary_header-old_notes"
id="listing_summary_header-old_notes" readonly="readonly" cols="50"
rows="5" style="width:320px; background: #EAF5F8;  height: 80px; font-
size: 0.7em;">
16/3/2009 - Vini Holden - 570 enqs - test
16/3/2009 - Vini Holden - 570 enqs - &amp;&amp;&amp;
</textarea>

Every 30 seconds a PeriodicalExecuter fires an Ajax call which checks
for new notes and updates the textarea using setValue if new notes are
found.

var feature_code = 'listing_summary_header'
oResponse['listing_notes']['data'].each(function (listingNote) {

if (!listingNote) {
return;
}

var d = new Date(listingNote['timestamp'] * 1000);
sListingNotes += d.getDate()+"/"+(d.getMonth()+1)+"/"+d.getFullYear()
+" - "+listingNote['user_full_name']+" - "+listingNote['text']+"\n";

});

$(feature_code+'-old_notes').setValue(sListingNotes);
$(feature_code+'-new_note').setValue('');

Unfortunately after the textarea is updated, any html encoded
characters display as the html encode (eg &amp; instead of &). When I
use developer toolbar to view the generated source it appears to be
correct (no double encoding).

I routinely test in the following browsers:

Firefox 3.0.7
IE 7.0.6001.18000
Chrome 1.0.154.48
Firefox 2.0.0.20
Opera 9.52
Safari 3.1.2

The issue appears in all of the above in the same way. The encoding is
done on the array once before it is sent to the javascript via ajax
via JSON string.

Any thoughts?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to