0

I have the following input, using php variables:

<td align='left'>input name='fielding[]'  type='text' id='fielding' class='fielding' size='60' maxlength='60' value='$fielding1$fielding2$fielding3' /></td>

A typical value may be 2b,ss,3b

Where

$fielding1 = “2b,”
$fielding2 = “ss,”
$fielding3 = “3b”

I have a search function that displays, for example, all shortstops (ss). When the data is displayed, I want to be able to change it, but I also want ss to be highlighted in red.

Like this 2b,ss,3b (pretend ss is red)

I know how to display it when not using a form input:

<td align='left'>$fielding1<span style='font-weight:bold;color:#F00;'>$fielding2</span>$fielding3</td>

Or use a class, but I’m showing inline style to better show what I'm trying to do.

user2140857
  • 129
  • 12
  • Use a textarea instead, than you can color it. – skobaljic Jan 31 '15 at 21:16
  • Cannot get it to work. If I add any HTML tags, within the textarea, it will show up as it is. I'm obviously doing something wrong? ...rows='1'>$fielding1$fielding2$fielding3 – user2140857 Jan 31 '15 at 22:17
  • Sorry my mistake. It was `contenteditable` attribute, take a look at [this example](http://jsfiddle.net/abqx5ekk/). – skobaljic Feb 01 '15 at 11:01

0 Answers0