-2

如果該值被插入我在分割24小時,以12份驗證時間爲輸入文本框

(12:00AM to 02:00Am, 
02:00AM to 04:00AM, 
04:00AM to 06:00AM, 
06:00AM to 08:00AM, 
08:00AM to 10:00AM, 
10:00Am to 12:00PM, 
12:00PM to 02:00pm, 
02:00pm to 04:00pm, 
04:00pm to 06:00pm, 
06:00pm to 08:00pm, 
08:00pm to 10:00pm, 
10:00pm to 12:00pm) 

(12:上午12點到上午02點00分)的文本框它應該與系統檢查時間,時間是12至凌晨2點,如果因此它允許插入record.vise反之亦然所有領域如何實現

+0

在目前的狀態下,你的問題幾乎無法理解。在提問之前,請閱讀https://stackoverflow.com/help/how-to-ask鏈接。 – avismara

回答

0

你的HTML應該呈現這樣的事:

<h3>Current time is 5:56pm</h3> 

    <form> 
     <fieldset> 
      <legend>Time intervals:</legend> 
      ...<br /> 
      2:00pm - 4:00pm: 
      <input type="text" disabled><br> 
      4:00pm - 6:00pm: 
      <input type="text"><br> 
      6:00pm - 8:00pm: 
      <input type="text" disabled><br> 
      8:00pm - 10:00pm: 
      <input type="text" disabled><br> 
      ... 
     </fieldset> 
    </form> 

創建JavaScript函數這將禁用不符合當前時間的輸入。