1

Is there anyway to show text in input text and not as hmtl. I mean: This is</b> bold"/>

I would like to see in the text input This is bold

for the output of input text.

Is there any way to do that? 'Cos I now see this in output: <\b>This is<\b> bold

2 Answers 2

1

Short answer? No. Rich text is not a feature of html text input fields.

If you are looking for a full scale What-You-See-Is-What-You-Get (WYSIWYG) editor, than check out TinyMCE or Aloha. They use several iFrames and other trickery to provide rich text as input.

IMO, you should use plain text and a markup language. Take a look at what StackOverflow implements on this very site for asking/answering questions. Its a <text area> input that accepts markdown as input and writes an html preview to a separate element on the page.

In the end, the choice depends on your user base. If they are mainly programmers and tech heads, its probably safe to use a markup language and <text area> input. If they are the typical service consumer, TinyMCE or something similar might be your best bet for usability.

Sign up to request clarification or add additional context in comments.

Comments

1

You can't.

In a usual html input (type text or a textarea), you can fill only plain text, the html tags are not rendered.

The only way to do that is to use a wysiwyg editor. Ususally in the form of a JavaScript component to add to your page.

There is a lot of wysiwyg editor on the internet, from the simplest to the most complete.

2 Comments

That means javascript rendering it. They use javascript, but I dont know how they render the HTML.
no html is always rendered by the browser, the javascript editors helps you to create something that look like an HTML field but is instead a common HTML element (a div, a frame, etc.) where you can enter formated content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.