On Mar 17, 11:02 am, ViniH <vinihol...@googlemail.com> wrote:
> 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).

I would like to see the reasons why, it doesn't make sense to me:

Sending XHTML as text/html Considered Harmful
<URL: http://www.hixie.ch/advocacy/xhtml >


\>
> 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.

As previously discussed here, setAttribute sets the HTML attribute,
which does not update the displayed value in some browsers.  For DOM
properties that map to HTML attributes, use the dot property.

Note that for an HTML textarea element, the value is the content of
the element, *it doesn't have a value attribute*.

<URL: http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA >

Either append the new value as a text node and use ISO 10646 character
numbers, or use innerHTML with character entity names, e.g. to change
the value to "Jack & Jill" use:

  var t = $(textarea);
  t.innerHTML = 'Jack &amp; Jill';

or

  t.appendChild(document.createTextNode('Jack \u0026 Jill'));


--
Rob
--~--~---------~--~----~------------~-------~--~----~
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