[thelist] Applying formatting to Form

Santilal Parbhu santilal at scorpioneng.co.nz
Sun Dec 2 14:22:31 CST 2007


Hi 

 

I am trying to format one item in a form field, to highlight it.  I have
tried googling and read through all the texts I have, but could find
anything.  Here is what I am trying to do.

 

I am using PHP4 to populate a form with a drop-down menu.  The menu data is
read from MySQL.  I want to highlight the Team:  XXXX, field to make it
stand out from the rest of the data in the line.  Something like:

 

Team ID: 29, Team: AAA, Grade: Test  ("Team:  AAA" is in yellow and bold!)

 

The code I am using is:

 

print'<form action="editteams.php" method="post">

            <p>Select team for updating: <select name="team_name"></p>';

            $query = "SELECT DISTINCT teams_id, team_name, grade FROM
$compteams ORDER BY team_name ";

            if (@mysql_query($query)) {

                        $r= mysql_query($query);

                        while ($row = mysql_fetch_row($r)) {

                                    $rrowid=$row[0];

                                    $rrow=$row[1];

                                    $rrrow=$row[2];

                                                

                                    print "<option
value=$rrowid,$rrow,$rrrow,>";

                                    print"Team ID: $rrowid,    <span
class=\"alertyellow\"><b>Team: $rrow</b></span>   , Grade :$rrrow</option>";

                                    }

            print'</select>

            <input type="submit" name="choose_team" value="Update this
team!" />

            </form></div>';

            }

 

A snippet from the HTML is:

 

id="gradeform"><form action="editteams.php" method="post">

                        <p>Select team for updating: <select
name="team_name"></p><option value=29,AAA,Test,>

Team ID: 29,    <span class="alertyellow"><b>Team: AAA</b></span>, Grade
:Test</option> . 

 

I have a style sheet which has the following rule:

 

.alertyellow {

                        font-size:120%;

                        color:#ef9c00;

                        }

 

The HTML suggests that the lettering should come out yellow, but it doesn't.
I use the alertyellow class elsewhere and it works fine.  Is it possible to
hightlight one item in a form field?

 

Thanks and regards,

 

Santilal

 

 




More information about the thelist mailing list