Highlighting text

J

JemPower

Hi All,

I'm trying to create a VERY simple text editing page, using a textbox that
the user can type, and some buttons to make the selected text bold, italic,
underline, etc, etc.

I've seen a few example that use the DIV and CONTENTEDITABLE, and the
"ExecCommand" however I have 2 problems with this. Firstly, whilst it
works, the VS.NET IDE underlines this words as an invalid command. The
second problem (and more serious), is that some of our customers are Mac
users, and this doesn't work at all.

Therefore, I thought if I could revert to standard controls, it should be
compatable with PC and Mac.

However I'm stuck at the first hurdle, I simply can't see anywhere that I
can modify what text is highlighted in the textbox!!

Does anyone have any ideas over this, it's really driving me mad...!

TIA
 
N

Natty Gur

Hi,

You can achieve it (and much more) using TextRange select method.
(Client side DHTML)

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top