Loading ...
Sorry, an error occurred while loading the content.

Re: TreeView Node - Error when embedded textarea contains an ENTER character

Expand Messages
  • melindafowler80
    ... from ... the ... error ... false); ... PHP, ... Thank you! that got me on track. I ended up with both CR and LF to deal with so I used the two-line
    Message 1 of 3 , Mar 6, 2008
    View Source
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, Fiouz <fiouzy@...> wrote:
      >
      > On 3/5/08, melindafowler80 <melindafowler80@...> wrote:
      > > In using a tree view to drill down user input, I ran across a user
      > > formatting a <textarea> with the Enter Key to space his data out
      from
      > > line to line. It is handled correctly in all other displays of
      the
      > > field, but in the TextNode the first <ENTER> character stops the
      > > display. The entire page is built but will not displayed. The
      error
      > > message is "undetermined string content".
      > >
      > > new YAHOO.widget.TextNode("<font color=$MPTCOLOR><table
      > > width=738px><tr><td width=373px><textarea cols=60
      > > rows=5>$MPNNOTE</textarea></td></tr></table></font>", tmpNode,
      false);
      > >
      > > If anybody has any suggestions, I would really appreciate it.
      >
      > You just can't have a Javascript String literal to span over lines.
      >
      > Just replace the content of your $MPNOTE variable with, if using
      PHP,
      > something like nl2br($MPNOTE)
      >
      > Regards,
      > --
      > Fiouz
      >
      Thank you! that got me on track. I ended up with both CR and LF to
      deal with so I used the two-line conversion:
      $MPNNOTE = str_replace(chr(13),'',$MPNNOTE);
      $MPNNOTE = str_replace(chr(10),'<br>',$MPNNOTE);
      It worked beautifully.

      Thank you again,
      Melinda
    Your message has been successfully submitted and would be delivered to recipients shortly.