title: How do I validate start time and end time using select
body: <p>I have 2 really very big select boxes which I think is not the best approach for selecting the time. 
  I have to restrict user from selecting start time lesser than end time. I mean the hours of operation during which my hotel is open. Here is what I have done using select.</p>
  
  <pre><code>&lt;div class="weekends"&gt;
      &lt;label for=""&gt;Weekdays&lt;/label&gt;
      &lt;select class="startTimeWeekDays" name="" id=""&gt;
          &lt;option value="1am" &lt;?php if( '1am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;1am&lt;/option&gt;
          &lt;option value="2am" &lt;?php if( '2am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;2am&lt;/option&gt;
          &lt;option value="3am" &lt;?php if( '3am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;3am&lt;/option&gt;
          &lt;option value="4am" &lt;?php if( '4am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;4am&lt;/option&gt;
          &lt;option value="5am" &lt;?php if( '5am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;5am&lt;/option&gt;
          &lt;option value="6am" &lt;?php if( '6am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;6am&lt;/option&gt;
          &lt;option value="7am" &lt;?php if( '7am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;7am&lt;/option&gt;
          &lt;option value="8am" &lt;?php if( '8am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;8am&lt;/option&gt;
          &lt;option value="9am" &lt;?php if( '9am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;9am&lt;/option&gt;
          &lt;option value="10am" &lt;?php if( '10am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;10am&lt;/option&gt;
          &lt;option value="11am" &lt;?php if( '11am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;11am&lt;/option&gt;
          &lt;option value="12am" &lt;?php if( '12am'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;12am&lt;/option&gt;
          &lt;option value="1pm" &lt;?php if( '1pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;1pm&lt;/option&gt;
          &lt;option value="2pm" &lt;?php if( '2pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;2pm&lt;/option&gt;
          &lt;option value="3pm" &lt;?php if( '3pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;3pm&lt;/option&gt;
          &lt;option value="4pm" &lt;?php if( '4pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;4pm&lt;/option&gt;
          &lt;option value="5pm" &lt;?php if( '5pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;5pm&lt;/option&gt;
          &lt;option value="6pm" &lt;?php if( '6pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;6pm&lt;/option&gt;
          &lt;option value="7pm" &lt;?php if( '7pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;7pm&lt;/option&gt;
          &lt;option value="8pm" &lt;?php if( '8pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;8pm&lt;/option&gt;
          &lt;option value="9pm" &lt;?php if( '9pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;9pm&lt;/option&gt;
          &lt;option value="10pm" &lt;?php if( '10pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;10pm&lt;/option&gt;
          &lt;option value="11pm" &lt;?php if( '11pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;11pm&lt;/option&gt;
          &lt;option value="12pm" &lt;?php if( '12pm'== $this-&gt;user-&gt;getConcept()-&gt;getWeekdayStartTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;12pm&lt;/option&gt;
      &lt;/select&gt;
      &lt;select class="endTimeWeekDays" name="" id=""&gt;
          &lt;option value="1am" &lt;?php if( '1am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;1am&lt;/option&gt;
          &lt;option value="2am" &lt;?php if( '2am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;2am&lt;/option&gt;
          &lt;option value="3am" &lt;?php if( '3am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;3am&lt;/option&gt;
          &lt;option value="4am" &lt;?php if( '4am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;4am&lt;/option&gt;
          &lt;option value="5am" &lt;?php if( '5am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;5am&lt;/option&gt;
          &lt;option value="6am" &lt;?php if( '6am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;6am&lt;/option&gt;
          &lt;option value="7am" &lt;?php if( '7am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;7am&lt;/option&gt;
          &lt;option value="8am" &lt;?php if( '8am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;8am&lt;/option&gt;
          &lt;option value="9am" &lt;?php if( '9am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;9am&lt;/option&gt;
          &lt;option value="10am" &lt;?php if( '10am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;10am&lt;/option&gt;
          &lt;option value="11am" &lt;?php if( '11am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;11am&lt;/option&gt;
          &lt;option value="12am" &lt;?php if( '12am' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;12am&lt;/option&gt;
          &lt;option value="1pm" &lt;?php if( '1pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;1pm&lt;/option&gt;
          &lt;option value="2pm" &lt;?php if( '2pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;2pm&lt;/option&gt;
          &lt;option value="3pm" &lt;?php if( '3pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;3pm&lt;/option&gt;
          &lt;option value="4pm" &lt;?php if( '4pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;4pm&lt;/option&gt;
          &lt;option value="5pm" &lt;?php if( '5pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;5pm&lt;/option&gt;
          &lt;option value="6pm" &lt;?php if( '6pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;6pm&lt;/option&gt;
          &lt;option value="7pm" &lt;?php if( '7pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;7pm&lt;/option&gt;
          &lt;option value="8pm" &lt;?php if( '8pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;8pm&lt;/option&gt;
          &lt;option value="9pm" &lt;?php if( '9pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;9pm&lt;/option&gt;
          &lt;option value="10pm" &lt;?php if( '10pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;10pm&lt;/option&gt;
          &lt;option value="11pm" &lt;?php if( '11pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;11pm&lt;/option&gt;
          &lt;option value="12pm" &lt;?php if( '12pm' == $this-&gt;user-&gt;getConcept()-&gt;getWeekdayEndTime()): ?&gt;selected&lt;?php endif ?&gt;&gt;12pm&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now I have to restrict user to choose end time greater than start time, lets say user selects 10am then must select greater than 10am or in terms of pm like real time. using jquery.
  HERE IS WHAT YOU CAN SEE <a href="http://jsfiddle.net/ne4ppkoe/" rel="nofollow">FIDDLE</a></p>