Thanks. I have read the howto.
I want to make this new field mandatory. I can see the red asterisk, but no error message came out if I were to leave the field blank. My new table looks like this:
mysql> desc ost_locations;
+----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| location | varchar(100) | NO | | NULL | |
+----------+------------------+------+-----+---------+----------------+
2 rows in set (0.03 sec)
mysql> select * from ost_locations;
+----+---------------+
| id | location |
+----+---------------+
| 1 | Head Quarters |
| 2 | City 1 |
| 3 | City 2 |
| 4 | City 3 |
+----+---------------+
4 rows in set (0.00 sec)
And I have this in ~/include/client/open.inc.php
start test
<tr>
<th nowrap >Location:</th>
<td>
<select name=location>
<option value=0 selected>--select one--</option>
<?
$locations= db_query('SELECT id,location FROM ost_locations ORDER BY id');
while (list($id,$name) = db_fetch_row($locations)){
$ck=($info==$id)?'selected':''; ?>
<option value="<?=$id?>" <?=$ck?>><?=$name?></option>
<?}?>
</select>
<font class="error"><b>*</b> <?=$errors?></font>
</td>
</tr>
end test
Wonder if I have miss any part ?