title: javascript validation on drop down lists
body: <p>I have two dropdown lists to select value from 0 to 23. What I want is that when the user selects a value from the first list, he cannot select a value lower than this value in the second list.</p>
  
  <p>How should I add validation through javascript here? !!</p>
  
  <pre><code>&lt;select name="hourfrom"&gt;
      &lt;option value="0" @(Request["hourfrom"] == "0" ? " selected=\"selected\"" : "") &gt;0&lt;/option&gt;
      &lt;option value="1" @(Request["hourfrom"] == "1" ? " selected=\"selected\"" : "") &gt;1&lt;/option&gt;
      &lt;option value="2" @(Request["hourfrom"] == "2" ? " selected=\"selected\"" : "") &gt;2&lt;/option&gt;
      &lt;option value="3" @(Request["hourfrom"] == "3" ? " selected=\"selected\"" : "") &gt;3&lt;/option&gt;
      &lt;option value="4" @(Request["hourfrom"] == "4" ? " selected=\"selected\"" : "") &gt;4&lt;/option&gt;
      &lt;option value="5" @(Request["hourfrom"] == "5" ? " selected=\"selected\"" : "") &gt;5&lt;/option&gt;
      &lt;option value="6" @(Request["hourfrom"] == "6" ? " selected=\"selected\"" : "") &gt;6&lt;/option&gt;
      &lt;option value="7" @(Request["hourfrom"] == "7" ? " selected=\"selected\"" : "") &gt;7&lt;/option&gt;
      &lt;option value="8" @(Request["hourfrom"] == "8" ? " selected=\"selected\"" : "") &gt;8&lt;/option&gt;
      &lt;option value="9" @(Request["hourfrom"] == "9" ? " selected=\"selected\"" : "") &gt;9&lt;/option&gt;
      &lt;option value="10" @(Request["hourfrom"] == "10" ? " selected=\"selected\"" : "") &gt;10&lt;/option&gt;
      &lt;option value="11" @(Request["hourfrom"] == "11" ? " selected=\"selected\"" : "") &gt;11&lt;/option&gt;
      &lt;option value="12" @(Request["hourfrom"] == "12" ? " selected=\"selected\"" : "") &gt;12&lt;/option&gt;
      &lt;option value="13" @(Request["hourfrom"] == "13" ? " selected=\"selected\"" : "") &gt;13&lt;/option&gt;
      &lt;option value="14" @(Request["hourfrom"] == "14" ? " selected=\"selected\"" : "") &gt;14&lt;/option&gt;
      &lt;option value="15" @(Request["hourfrom"] == "15" ? " selected=\"selected\"" : "") &gt;15&lt;/option&gt;
      &lt;option value="16" @(Request["hourfrom"] == "16" ? " selected=\"selected\"" : "") &gt;16&lt;/option&gt;
      &lt;option value="17" @(Request["hourfrom"] == "17" ? " selected=\"selected\"" : "") &gt;17&lt;/option&gt;
      &lt;option value="18" @(Request["hourfrom"] == "18" ? " selected=\"selected\"" : "") &gt;18&lt;/option&gt;
      &lt;option value="19" @(Request["hourfrom"] == "19" ? " selected=\"selected\"" : "") &gt;19&lt;/option&gt;
      &lt;option value="20" @(Request["hourfrom"] == "20" ? " selected=\"selected\"" : "") &gt;20&lt;/option&gt;
      &lt;option value="21" @(Request["hourfrom"] == "21" ? " selected=\"selected\"" : "") &gt;21&lt;/option&gt;
      &lt;option value="22" @(Request["hourfrom"] == "22" ? " selected=\"selected\"" : "") &gt;22&lt;/option&gt;
      &lt;option value="23" @(Request["hourfrom"] == "23" ? " selected=\"selected\"" : "") &gt;23&lt;/option&gt;
  
      &lt;/select&gt;
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>    &lt;select name="hourto"&gt;
        &lt;option value="0" @(Request["hourto"] == "0" ? " selected=\"selected\"" : "") &gt;0&lt;/option&gt;
      &lt;option value="1" @(Request["hourto"] == "1" ? " selected=\"selected\"" : "") &gt;1&lt;/option&gt;
      &lt;option value="2" @(Request["hourto"] == "2" ? " selected=\"selected\"" : "") &gt;2&lt;/option&gt;
      &lt;option value="3" @(Request["hourto"] == "3" ? " selected=\"selected\"" : "") &gt;3&lt;/option&gt;
      &lt;option value="4" @(Request["hourto"] == "4" ? " selected=\"selected\"" : "") &gt;4&lt;/option&gt;
      &lt;option value="5" @(Request["hourto"] == "5" ? " selected=\"selected\"" : "") &gt;5&lt;/option&gt;
      &lt;option value="6" @(Request["hourto"] == "6" ? " selected=\"selected\"" : "") &gt;6&lt;/option&gt;
      &lt;option value="7" @(Request["hourto"] == "7" ? " selected=\"selected\"" : "") &gt;7&lt;/option&gt;
      &lt;option value="8" @(Request["hourto"] == "8" ? " selected=\"selected\"" : "") &gt;8&lt;/option&gt;
      &lt;option value="9" @(Request["hourto"] == "9" ? " selected=\"selected\"" : "") &gt;9&lt;/option&gt;
      &lt;option value="10" @(Request["hourto"] == "10" ? " selected=\"selected\"" : "") &gt;10&lt;/option&gt;
      &lt;option value="11" @(Request["hourto"] == "11" ? " selected=\"selected\"" : "") &gt;11&lt;/option&gt;
      &lt;option value="12" @(Request["hourto"] == "12" ? " selected=\"selected\"" : "") &gt;12&lt;/option&gt;
      &lt;option value="13" @(Request["hourto"] == "13" ? " selected=\"selected\"" : "") &gt;13&lt;/option&gt;
      &lt;option value="14" @(Request["hourto"] == "14" ? " selected=\"selected\"" : "") &gt;14&lt;/option&gt;
      &lt;option value="15" @(Request["hourto"] == "15" ? " selected=\"selected\"" : "") &gt;15&lt;/option&gt;
      &lt;option value="16" @(Request["hourto"] == "16" ? " selected=\"selected\"" : "") &gt;16&lt;/option&gt;
      &lt;option value="17" @(Request["hourto"] == "17" ? " selected=\"selected\"" : "") &gt;17&lt;/option&gt;
      &lt;option value="18" @(Request["hourto"] == "18" ? " selected=\"selected\"" : "") &gt;18&lt;/option&gt;
      &lt;option value="19" @(Request["hourto"] == "19" ? " selected=\"selected\"" : "") &gt;19&lt;/option&gt;
      &lt;option value="20" @(Request["hourto"] == "20" ? " selected=\"selected\"" : "") &gt;20&lt;/option&gt;
      &lt;option value="21" @(Request["hourto"] == "21" ? " selected=\"selected\"" : "") &gt;21&lt;/option&gt;
      &lt;option value="22" @(Request["hourto"] == "22" ? " selected=\"selected\"" : "") &gt;22&lt;/option&gt;
      &lt;option value="23" @(Request["hourto"] == "23" ? " selected=\"selected\"" : "") &gt;23&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>