Page 1 of 1
Can this be done?
Posted: Fri Aug 29, 2003 1:35 am
by illmapu
Hi,
I have text(field) that I would like to have certain text be hi-lited, does anyone know if this can be done?
Thanks in advance!

Posted: Fri Aug 29, 2003 1:58 am
by Nay
do you mean highlighted?
-Nay
Posted: Fri Aug 29, 2003 5:55 am
by Jean-Yves
I assume that you mean a form field, ie <input type='text' etc...
If you create a stylesheet class (eg myclass1) with the required colour, you can then say, for example (red text):
Code: Select all
<style>
.myclass1{color:#ff0000;}
</style>
Code: Select all
$option = 1; //change this to use another class, eg green, blue, etc, etc...
echo "<input type='text' name='text1' id='text1' class='myclass$option' />\n";
This would make the text colour (and other attributes, font etc) be what you want. Works on other objects too, such as buttons, <select> tags, etc..
As far as I know however, it is not possible to have just one part of the text highlighted. You'd probably need a java applet or activeX control for that, but that's outside of my experience.