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 ?
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.
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!