Multiline text box shows html

23 views
Skip to first unread message

Anthony Pri

unread,
Jun 10, 2015, 2:56:03 PM6/10/15
to ang...@googlegroups.com
I have a  <textarea style="width: 241px; height: 83px;" col="180px" rows="3" ng-attr-id="{{ 'object-' + q.FileID }}"  ng-model="q.answer">

when i submit the text box with breaks or paragraphs i replace the \n with br tag.  when i go back and prefill the information from the database. the textbox shows the br tag

example.
testing
testing3
testing4

return data.
testing<br>
testing3<br>
testing4

Sander Elias

unread,
Jun 10, 2015, 11:54:20 PM6/10/15
to ang...@googlegroups.com
Hi Anthony,

A textarea will show you what you put in. There is no HTML parsing in there. So if you put in the text <br> that is exactly what you get.

Regards
Sander

Anthony Pri

unread,
Jun 11, 2015, 4:00:15 AM6/11/15
to ang...@googlegroups.com

So this is impossible.

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/PzjrSh6c2-w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Robert STAICU

unread,
Jun 11, 2015, 5:05:26 AM6/11/15
to ang...@googlegroups.com
Sorry, but maybe you want something like this? http://ngmodules.org/modules/angular-wysiwyg

Sander Elias

unread,
Jun 11, 2015, 7:29:09 AM6/11/15
to ang...@googlegroups.com
Hi Anthony,

No, in our business virtually nothing is impossible :)
If you get your data back from your DB, you need to do the reverse, (exchange every `<br>` with an `\n` with an regex)
That way you can keep using your textarea. If you need a full-blown texteditor, Robert has linked in one, but there are many of those.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages