Click to See Complete Forum and Search --> : indicating required field as yellow color


rosy
11-13-2006, 04:28 PM
How to indcate user , as required field?
Having textbox and combo box?

devinemke
11-13-2006, 06:09 PM
<?php
$fields = array(
'first_name' => 'req',
'last_name' => 'req',
'email' => 'req',
'height' => '',
'weight' => '',
'age' => '',
'address' => 'req'
);

foreach ($fields as $key => $value)
{
if ($value == 'req') {$color = 'yellow';} else {$color = 'grey';}
echo $key . ': <input type="text" name="' . $key . '" style="background: ' . $color . '"><br>';
}
?>