-3
我們有表格輸入以獲取用戶的早晨&晚上時間。未選中時在輸入欄中設置特定值
如果用戶必須輸入上午時間,他必須檢查複選框。如果沒有被檢查,它就會變得模糊不清,他無法填補它的價值。
當它未被選中時,time1的默認值爲& time2應該是「00:00」。
晚上時間也一樣。
請建議如何操作。
<table border="1"">
<tr>
<th colspan="3">User Timing</th>
</tr>
<tr>
<td>Morning</td>
<td><input name="morning" type="checkbox" id="set_val1" value="1"></td>
<td><input type="time" name="time1" min="" class="timing" value="<?php echo $time1; ?>" placeholder="" required>
to
<input type="time" name="time2" min="" class="timing" value="<?php echo $time2; ?>" placeholder="" required>
</td>
</tr>
<tr>
<td>Evening</td>
<td><input name="evening" type="checkbox" id="set_val2" value="00:00"></td>
<td><input type="time" name="time3" min="" class="timing" value="<?php echo $time3; ?>" placeholder="" required>
to
<input type="time" name="time4" min="" class="timing" value="<?php echo $time4; ?>" placeholder=""required></td>
</tr>
</table>
這不是它的工作原理; SO不是免費的編碼服務。你應該做研究。處理點擊和模糊元素是非常基本的DOM操作,你可以找到大量的教程。 –
我做過了,但很混亂 – Observer