How to display html format in text area - html

I have created but now when user add html formating in that text area with html codes like
<b>the codes are working </b>
they are showing up same as written, instead of "the codes are working "
so how do i enable that in simple HTML form.

Textarea cannot display any html structure. You should use <pre> tag, but if you want to edit in the same time, use contenteditable attribute.
<pre contenteditable="true"><b>the codes are working</b></pre>
I think that you are trying some editor. You can use CKEditor. Quirksmode.org also can be useful.

Related

online HTML editor which preserves attributes

Are there any free online HTML editors which preserve custom attributes in the code when you're editing the text field? The ones I've tested remove them beyond W3C standards (list below, will add to post based on suggestions).
EDIT: The idea is to have the changes I make to the output be reflected in the text fields of each HTML tag, then copy the changed HTML back out again. More advanced playgrounds like Codepen/JSFiddle unfortunately don't allow editing of the output, just the code.
https://htmlg.com/html-editor
https://html5-editor.net
https://wordtohtml.net
Example code - post in the HTML field of editor then change the text field:
<a id="id" class="class" first="FIRST" last="LAST">
This link has information outside of the conventional attributes.
</a>
Try these:
- https://jsfiddle.net/
- https://codepen.io
Is it what you want?

How to Display Formatted Text From HTML in Tapestry

In my TextArea, I'm using CKEditor as a mixins, and all changes, include the formatting goes to my DB. How to display it as formatted text, which means if HTML is <b>My Name</b> is <i>Hobas</i> will displayed as My Name is Hobas. I've tried JSoup but it looks like that lib doesn't support this job.
Use the OutputRaw component in your template (.Tml) file:
See http://tapestry.apache.org/5.4/apidocs/org/apache/tapestry5/corelib/components/OutputRaw.html

How to convert plain text to html but keep the display format?

I have one plain text which is program output, but I want to display it in html page. But still I want to keep the formats (like space/tab/enter and etc.), it's just like the code block of stackoverflow, how can I display it properly in html ? Thanks
Use the "pre" and "code" HTML tags:
<pre><code> code in here... </code></pre>
<code> the program</code>

tinymce : how to convert raw html tags?

i used tinymce to allow people to write content. But now i wan't them to edit their own content, i need to use tinymce again.
My problem is in my database, this content is composed of html tags, and when i try to load the text in my tinymce textarea (in edit view), i've got the raw content eg <p> Hello my name is <em>John</em> [...] </p> . But when they written this content, it was with "wysiwyg".
I want to convert this raw html to wysiwig.
here a screenshot of the raw html
and i want it to be like this when they click on "edit my content" button :
I use this:
echo <textarea name="icerik" id="editor1" rows="10" cols="80">'.htmlentities($satir->icerik).'</textarea>;
I use "htmlentities" method in php to convert html code to wysiwyg. When you write that converted text between and , you can get what you want.
Assuming you're using PHP of course. If not, try to search like for example "htmlentities in asp.net" or wait for another answers.
tinyMCE.activeEditor.setContent('<span>html data from your database</span>');
Use this:
strip_tags(stripslashes('row html content'))

Show html code as rendered html text

I am trying to take some input from the user with the wisywig text editor plugin. But, when I try to show the text in a label or paragraph, all the html tags become visible.
For example,
#string str = "<b>sample text</b>";
<label>#str</label>
should look like
sample text
But it is not. It looks like,
<b>sample text</b>
How can I render a html code string into a html text...???
i am working with .net mvc3 with razor view engine...
That may happen if HTML entiries are being encoded.
You need to avoid that encoding or do decoding. For example, in PHP you can use http://php.net/manual/en/function.html-entity-decode.php to decode HTML entities.