tramworksnick
asked on
can I set color of text within the line of attached php?
Hi
I've a line of text I want to change color on within php - the color of the line is set by CSS for all instances of textarea so I can't change via CSS without affecting the rest of the site - I'd like to specify within this code the color I want the text to appear here
the code that sets html output is where I'm hoping alternatively it may be possible to add another parameter to set a color -
thanks
I've a line of text I want to change color on within php - the color of the line is set by CSS for all instances of textarea so I can't change via CSS without affecting the rest of the site - I'd like to specify within this code the color I want the text to appear here
<td><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
the code that sets html output is where I'm hoping alternatively it may be possible to add another parameter to set a color -
////
// Output a form textarea field
function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
global $HTTP_GET_VARS, $HTTP_POST_VARS;
$field = '<textarea name="' . tep_output_string($name) . '" wrap="' . tep_output_string($wrap) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
$field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
} elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
$field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
}
} elseif (tep_not_null($text)) {
$field .= tep_output_string_protected($text);
}
$field .= '</textarea>';
return $field;
}
thanks
ASKER
sorry - had no effect
<td><?php echo tep_draw_textarea_field('m essage', 'soft', 40, 8,'style="color:blue;backg round-colo r:white;" '); ?></td>
should affect only that specific textarea (but as a whole). What you cannot do is change the color for a specific line of text within the textarea.
should affect only that specific textarea (but as a whole). What you cannot do is change the color for a specific line of text within the textarea.
ASKER
Hi
I want to change all the text but still no joy but this time its displayed white text as before but added as text - style="color:black;backgro und-color: white;"
I want to change all the text but still no joy but this time its displayed white text as before but added as text - style="color:black;backgro
try adding important! at the end of each rule:
<td><?php echo tep_draw_textarea_field('m essage', 'soft', 40, 8,'style="color:black !important;background-colo r:white !important;" '); ?></td>
<td><?php echo tep_draw_textarea_field('m
ASKER
just added !important to white text - sorry
>>I want to change all the text but still no joy but this time its displayed white text as before but added as text - style="color:black;backgro und-color: white;"
background-color:white is the default (unless you are explicitly overriding them via css). Are you sure you don't want:
background-color:black; color:white;
background-color:white is the default (unless you are explicitly overriding them via css). Are you sure you don't want:
background-color:black; color:white;
If the problem persists, look at your browser's source code. What is the markup that your page is producing?
ASKER
Hi
Definitely want black on white background - I've got the white background no problem just want to set the text to black
Output below -
Definitely want black on white background - I've got the white background no problem just want to set the text to black
Output below -
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr>
<td><table cellpadding="0" cellspacing="5" border="0" width="100%">
<tr><td><textarea name="message" wrap="soft" cols="40" rows="8">style="color:black !important;background-color:white !important;" </textarea></td></tr>
</table></td>
</tr>
</table></td>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for persevering - a big help
Open in new window