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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding values to text field from popup - JavaScript

Status
Not open for further replies.

danielleDee

Programmer
Jul 29, 2004
5
ZA
Hi All



I need to do the following in javascript:



I have a text field with a "format" button. When the button is clicked a

popup opens with say 3 checkbox options: paragraph, bold, underline. The user can then enter

text in the text box and apply formatting to the text entered. When the popup results are submitted, it should be displayed in the textbox as something like this:



<p><b>bold</b> text here </p>



By default <p> should come before <b> and <b> should come before <u> and </u></b></p> should come after the entered text.



I figured out how to populate a text box by clicking a button, but the values are all either added AFTER text or overwrites the text.



It would also help if the attributes could be added at CURSOR point with the click of a button or applied only to highlighted text.



Anyone have an idea how to apply this?



Thanx!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top