Which is where it is! However, where all the non-menu select fields, apart from the email address which checks for valid email address, use strlen() to check for validity, I obviously cannot use that for a menu field.
Logic tells me that something like:
should work but, although after validation the chosen menu item is retained, the error message that no selection has been made always appears. I’ve tried lots of other things but all with the same result…
I know I am not very good at this but I am trying, I’ve come a long way from being a complete non-programmer and I’m learning all the time, your help is very much appreciated.
ahahaha
what a silly mistake.
== not single =
hard to fihd though
they advise to write it countrary, to prevent such mistakes
(“Select One” == $region_name)
with = instead of == or === parse error will be raised
I don’t believe this! I was too hasty saying it works fine. It does in the sense that the error message does not come up when a selection has been made but if it is left as “select one” i.e. no selection is made then no error message comes up, so plainly it’s not working!!
just check what goes to your script from the form when no region selected
it can be empty string or Select one with some deviations such as spaces or letter case.
put var_dump($region_name); somethere, look at the output and correct that string to compare.