如果select 1大于select 2而没有mysql,则禁用/删除值

时间:2015-09-18 07:14:40

标签: php

如果所选的“from”值大于或等于它的值,我想禁用“to”的值。我见过类似的教程,但它包括ajax和mysql。但我的不需要任何疑问。谢谢!

 echo "<select name=\"from\" id=\"from\" class=\"form-control\" onchange=\"myfunc()\">";
            echo "<option value=\"10\"> 10:00 AM </option>";
            echo "<option value=\"11\"> 11:00 AM </option>";
            echo "<option value=\"12\"> 12:00 NN </option>";
            echo "<option value=\"13\"> 1:00 PM </option>";
            echo "<option value=\"14\"> 2:00 PM </option>";
            echo "<option value=\"15\"> 3:00 PM </option>";
            echo "<option value=\"16\"> 4:00 PM </option>";
            echo "<option value=\"17\"> 5:00 PM </option>";
            echo "<option value=\"18\"> 6:00 PM </option>";
            echo "<option value=\"19\"> 7:00 PM </option>";
            echo "<option value=\"20\"> 8:00 PM </option>"; 
            echo "</select>";

             echo "<select name=\"to\" id=\"to\" class=\"form-control\">";
            echo "<option value=\"10\"> 10:00 AM </option>";
            echo "<option value=\"11\"> 11:00 AM </option>";
            echo "<option value=\"12\"> 12:00 NN </option>";
            echo "<option value=\"13\"> 1:00 PM </option>";
            echo "<option value=\"14\"> 2:00 PM </option>";
            echo "<option value=\"15\"> 3:00 PM </option>";
            echo "<option value=\"16\"> 4:00 PM </option>";
            echo "<option value=\"17\"> 5:00 PM </option>";
            echo "<option value=\"18\"> 6:00 PM </option>";
            echo "<option value=\"19\"> 7:00 PM </option>";
            echo "<option value=\"20\"> 8:00 PM </option>";
             echo "</select>";

0 个答案:

没有答案