Solved

Format text in <option>

Posted on 2007-03-27
3
179 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
  • 2
3 Comments
 
LVL 29

Accepted Solution

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

Expert Comment

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

Author Comment

by:spoowiz
Comment Utility
thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now