Ensuring the form-filler, fills in a particular section?

Using formmail cgi (yep, I know about the weaknesses with the script, but can’t seem to find another way, without involving php), I can ensure that, if the person doesn’t complete an input section for their name, address etc, the next page after clicking the ‘send’ button tells them which fields they have missed, but how do you do it for a select option like below please ?

<SELECT style="text" name="Input">
<OPTION>Desired rank of film</OPTION> 
<OPTION>1</OPTION> 
<OPTION>2</OPTION> 
<OPTION>3</OPTION>
</SELECT> 

Any help appreciated.

Dez.

Anyone know who the mod is on this section please ?

Thanks.

Test the value of the field. If the value corresponds to the first entry then they haven’t selected anything.

If you actually add value attributes to the options you make it easier because you can use value=" " for the message option and then just test that the value passed isn’t a space.

Thanks Stephen, is that using anyhting to do with php please ? Anywhere on the net that I can see examples of this please ?

<SELECT style="text" name="Input">
<OPTION VALUE=" ">Desired rank of film</OPTION> 
<OPTION VALUE="1">1</OPTION> 
<OPTION VALUE="2">2</OPTION> 
<OPTION VALUE="3">3</OPTION>
</SELECT>

and

if ($_POST['Input'] == ' ') {
echo 'You fogot to select a film rank';
}

I like the sound of that Stephen, but there’s already some php code that has to go at the very top of the page, would this interfere with that please ?

Roll on the days when we can just put the required attribute (from HTML5) on the input - it works on Opera 10 but I don’t think it works on much else at the moment!