Highlight a specific line in a text area

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
chs
Profound User
Posts: 53
Joined: Tue Jan 27, 2015 8:13 am
First Name: Christoph
Last Name: Seitz
Company Name: Waser + Co. AG
Phone: +41 44 94 74 341
Address 1: Erlenwiesenstrasse 2
City: Volketswil
State / Province: Outside Canada/USA
Zip / Postal Code: 8604
Country: Switzerland
Contact:

Highlight a specific line in a text area

Post by chs »

Hi everyone,

I have a text area (widget type = text area) with several lines (font = courier new).

Is it possible to highlight a specific line within the text area ?

For example:
Text for line 1.
Text for line 2.
Text for line 3.
Text for line 4.

I tried to add <b> ..text.. </b> but it isn't working.

There is a hex code x'25' for return resp. line feed which works fine. Is there also a hex code to highlight a line or a few words within the text area ?

Is there another function or is the only way to achieve this goal to use a html container or to use java script code ?

Having a function to easily highlight a few lines or words within a text area would be very helpful.

Thank you for your help in advance.

Christoph
mcorbo
Profound User
Posts: 20
Joined: Fri Sep 08, 2017 8:14 am
First Name: Michael
Last Name: Corbo
Company Name: National Retail Systems
Phone: 2018042713
Address 1: 600 us rt 46w
City: Hasbrouck Heights
State / Province: New Jersey
Zip / Postal Code: 07601
Country: United States
Contact:

Re: Highlight a specific line in a text area

Post by mcorbo »

Instead of a text area, use an html container with the html property rather than the value property set.
html.JPG
html.JPG (27.64 KiB) Viewed 531 times
chs
Profound User
Posts: 53
Joined: Tue Jan 27, 2015 8:13 am
First Name: Christoph
Last Name: Seitz
Company Name: Waser + Co. AG
Phone: +41 44 94 74 341
Address 1: Erlenwiesenstrasse 2
City: Volketswil
State / Province: Outside Canada/USA
Zip / Postal Code: 8604
Country: Switzerland
Contact:

Re: Highlight a specific line in a text area

Post by chs »

Thank you for your input.

Using a simple grid with a textbox in each row instead of a text area is also working (see attached file).
Attachments
Grid.JPG
Grid.JPG (31.09 KiB) Viewed 519 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Highlight a specific line in a text area

Post by Scott Klement »

A text area is simply a widget that inserts the HTML <textarea> tag. This does not offer for any sort of special formatting.... and is a built-in capability of the browser that we cannot change.

The solutions that chs and DanD have offered are both output-only solutions, which seems strange considering that a text area is an input field. But, perhaps the input capability isn't needed?

If you do want to provide formatting like this in an input field,I'd suggest incorporating a 3rd party JavaScript library for a rich text editing box. We have an example of one popular choice known as TinyMCE in our documentation here: http://www.profoundlogic.com/docs/displ ... MCE+Editor
chs
Profound User
Posts: 53
Joined: Tue Jan 27, 2015 8:13 am
First Name: Christoph
Last Name: Seitz
Company Name: Waser + Co. AG
Phone: +41 44 94 74 341
Address 1: Erlenwiesenstrasse 2
City: Volketswil
State / Province: Outside Canada/USA
Zip / Postal Code: 8604
Country: Switzerland
Contact:

Re: Highlight a specific line in a text area

Post by chs »

Thank you for your answer.

I will have a look at the MCE Editor.

The textbox field in my grid is an input field. I have created a little editor with a simple grid, a textbox and a bit of Java Script code. See attached file.
Attachments
Editor.JPG
Editor.JPG (79.14 KiB) Viewed 497 times
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests