多个选择选项值在php中验证

时间:2013-07-02 09:07:58

标签: php

我在线预约表格有多个选择选项值。我的项目就像这个项目 (Show a second dropdown based on previous dropdown selection)

我在一些jquery代码上清除用户选择其他选项时的选项,事情就是我要如何验证表单,我的意思是在第二级选择选项值时至少选择一个选项。

我尝试在验证php页面使用此代码

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();
} 

每个$appointment_...都是select选项。 我只是想要选择至少一个选择选项,但似乎无论如何都无法提交。

0 个答案:

没有答案