Jump to content

[SOLVED] Bold within an option value?


grahamb314

Recommended Posts

Hi all,

 

I have this, but I wasn the text "Show:"  ,  Day: etc to be bold.

$DJshows = mysqli_query($mysqli, "SELECT * FROM schedule");

while ($show = mysqli_fetch_assoc($DJshows)) {
   
 echo "<option value=\"{$show['show']}\">{$show['ID']}  Show:{$show['Show']}  Day: $displayday Start:{$show['StartTime']} End:{$show['EndTime']}   </option>";
}

 

I tried

<strong> Day: </strong>

but it didnt't work!

 

any thoughts

Link to comment
https://forums.phpfreaks.com/topic/128016-solved-bold-within-an-option-value/
Share on other sites

$DJshows = mysqli_query($mysqli, "SELECT * FROM schedule");

while ($show = mysqli_fetch_assoc($DJshows)) {
   
echo "<option value=\"{$show['show']}\">{$show['ID']}  Show:{$show['Show']} <strong> Day:</strong> $displayday Start:{$show['StartTime']} End:{$show['EndTime']}   </option>";
}

I should really start reading the question title more.  ::) TBH, I don't know how to do this. I think that it may be a case of using JavaScript... but seeing as I've never done it before... I don't really know. Sorry for the false hope.

 

NP  - Thanks for your input!

Exactly what I thought,

 

but I have no Style Sheet.

 

Here is the entire page's code:

<?php

//require_once 'mysql_connect.php';  
require('../mysql_connect.php');

if ( $_POST["Day"] == 0 )
{$displayday = "Monday";}
else if ( $_POST["Day"] == 1) {$displayday = "Tuesday";}
else if ( $_POST["Day"] == 2) {$displayday = "Wednesday";}
else if ( $_POST["Day"] == 3) {$displayday = "Thursday";}
else if ( $_POST["Day"] == 4) {$displayday = "Friday";}
else if ( $_POST["Day"] == 5) {$displayday = "Saturday";}
else if ( $_POST["Day"] == 6) {$displayday = "Sunday";}

$DJshows = mysqli_query($mysqli, "SELECT * FROM schedule");

while ($show = mysqli_fetch_assoc($DJshows)) {
   
 echo "<option value=\"{$show['show']}\">{$show['ID']}  Show:{$show['Show']}  <b>Day:</b> $displayday Start:{$show['StartTime']} End:{$show['EndTime']}   </option>";

}
?>

Day: is still not bold on the page

 

I should really start reading the question title more.  ::) TBH, I don't know how to do this. I think that it may be a case of using JavaScript... but seeing as I've never done it before... I don't really know. Sorry for the false hope.

wow I just figured out what you were doing now....no wonder I was confused

This is a CSS issue not PHP

 

You gonna have to edit the CSS for select b, option b

select
select b, option b {
    font-weight: bold;
}

No matter what you try in css ie will ignore you on these pretty much i ve played with them before

Code:

<select name="month" class="month">
<option value="january" selected>january
<option value="february">february
<option value="march">march
<option value="april">april
<option value="may" class="one">may
<option value="june">june
<option value="july">july
<option value="august">august
<option value="september">september
<option value="october">october
<option value="november">november
<option value="december">december
</select>

 

 

accompanying css ...

Code:

 

.month {
background-color:#000000;
font-family:arial; 
color:#9999CC;
font-size:18px;
font-weight:bold;}

.one {
font-family:arial; 
color:#FF0000;
font-size:18px;
font-weight:bold;
background:#0000FF;}

 

in each case the, font-size:18px;font-weight:bold; is ignored, but at least you can 'highlight' with background color

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.