I have a sample of code below - in which there is a list box and a submit button. If no choice is clicked from the listbox I want a message "you must make a selection" How can I do this?
<tr>
<td height="40"><font face="Arial, Helvetica, sans-serif" color="#0000A0">Please
select the regional unit of your interest:</font></td>
</tr>
<tr>
<td width="49%" height="152">
<select name="cboregion" size="6" class="listbox">
<?php
/
Create your SQL statement
/
$sql="SELECT reg_id, reg_name from tbl_regions;";
$result_set = pg_Exec ($conn, $sql);
$rows = pg_NumRows($result_set);
if ((!$result_set) || ($rows < 1)) {
//No connection or no rows returned, so print an error
echo "<H1>ERROR - no rows returned</H1><P>";
exit; //exit the script
}
for ($j=0; $j < $rows; $j++) {
echo "<option value=".pg_result($result_set, $j, "reg_id")."> ".pg_result($result_set, $j, "reg_name")."</option>";
}
?>
</select>
<input type="submit" name="Submit" value="Submit" >