خرید بک لینک

Vote count: 0

I tried to do the javascript to validate the date enter is in correct way. For example, for ETA(estimate time arrival), the date should be earlier than ETD(estimate time departure).

This is the form:

   <form>
      <label>ETA</label>
             <input  id="etadate" name="etadate" type="date" />
             <input name="etatime" type="time"/> 
      <label>ETD</label>
             <input  id="etadate" name="etadate" type="date"/>
             <input name="etatime" type="time"/>                                                                                        
   </form>

And for the javascript:

function validate1
 {
       var x = document.getElementById("etadate");
       var y = document.getElementById("etddate");

       if (x < y)
       {
          true;
       }
       else
       {
          false;
       }
}

When i tried to run the code, it didnt give any notice to the user that the date for eta should be earlier than etd. I dont know where to adjust so the code run correctly.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 24 ارديبهشت 1395 ساعت: 13:21

صفحه بندی