Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML markup in textbox

Status
Not open for further replies.

ski1535

IS-IT--Management
Jun 17, 2008
128
US
I'm tring to make or format a text box with bold and bullets in the text box.

The textbox is tied to a field in a php database. When the textbox is populated I see the <strong> html markup but not the bold text.

I want to make the text box recognize html markup. Is this possible?
 
Short answer is No. Textboxes and text areas in html are just plain text capable, if you want to have stylized or rich text in a text box you need to use a rich text editor and embed it in your webpage.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
That is where the problem is. I'm using a rich text editor. However when it saves the rich text to php db, and I recall the info in a form, I get the <strong> html markup in the text box.
 
Are you using the same rich text editor to display the rich text once its recalled from the DB?

Also which rich text editor are you using?

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I'm not using the same editor, due to the fact I don't want the users to change the info, I just want it displayed. As far as the editor, I'm using one called KTML.

I'm thinking I will just need to rethink my logic. Right now I have the textbox tied to an onchange event, so I will need use something that I could use the onchange event on.

Any ideas, other than a textbox?
 
So how exactly are you displaying the enriched text once you recall it from the DB?

You either just display it outside of a text box as normal HTML or into the rich text editor?

If you display it out as normal html and not in a text editor then are you doing anything to the text before you display it?

If you look at the Source code for this text from your browser does it look normal or are < and > characters replaced with something else?




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I could just display it as normal text not in a box, but I basing the text being pulled from the db on what the user chooses in the dropdown box. For example, if the user chooses Florida, the textbox would be a description of Florida.
 
So why the ext box?, what's stopping you from actually just displaying the text say in a DIV. Whatever language you are using to display the text can just as easily display it out into div than into a textbox. And in the DIV the html will work as expected as won't be editable.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hum, not sure. Can the div be updated each time a user selects a differant item from the dropdown?

dave
 
Sure. Instead of outputting between <textarea><textarea> tags just do it between <div></div>.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top