multiple select option value validating in php
I have multiple select option value for online appointment form. My project is just like this project (Show a second dropdown based on previous dropdown selection)
I've on some jquery code to clear the option when user choose other option, the things is how I am going to validate the form, what I mean is at least one select option are selected at second level select option value.
I've tried using this code at validation php page
else if ($appointment_gc == " "
|| $appointment_fu == " "
|| $appointment_gas == " "
|| $appointment_col == " "
|| $appointment_ent == " "
|| $appointment_ort == " "
|| $appointment_ps == " "
|| $appointment_package == " " ) {
echo "Submission fails. You have not choose any package.
Please go back and try again.
<input style=\"padding:10px 20px;margin-top:20px;\"
type=button value=\"Back\" onClick=\"history.go(-1)\">";
exit();
}
each of$appointment_...
are select option.
I just want that at least one select option are selected, but seems that no matter how all failed to submit.