Solved

Format text in <option>

Posted on 2007-03-27
3
186 Views
Last Modified: 2007-03-27
In the code below, only "Current/History" text is correctly formatted as class "selectmenutext".
What is within the php code (<option>) text is not. How can I format the text in <option>?
As you can see, I tried both using class in <td> and <span>.
Thanks

<td  valign="center" width="120" bgcolor="#339999"  class=selectmenutext>
<span class=selectmenutext>
Current/History: <select onchange="window.location='index.php?coh='+this.value">
<?php
global $currORhist;
$list = array("Current","Historical");
for ($i = 0; $i <= 1; $i++) {
echo "<option value=\"$list[$i]\"";
if ($currORhist == $list[$i]) print " SELECTED";
echo ">" . $list[$i];
echo "</option>";
}
?>
</select>
</span>
0
Comment
Question by:spoowiz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 500 total points
ID: 18805861
echo "<option class=\"theClass\" value=\"$list[$i]\""
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18805863
<style type="text/css">
.theClass {
     //whatever you want
}
</style?
0
 

Author Comment

by:spoowiz
ID: 18805873
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question