title: Enabling 'Save' Button on index change
body: <p>I have a popup with 1 dropdown list (mandatory), 1 datepicker (mandatory) &amp; 1 textbox (optional). I am checking in 1st two that if they both contain any data and then I am enabling the 'Save' button. </p>
  
  <p>However, if the user already has some dropdown item in it and date picked then also, the 'Save' button is enabled. I dont want this. So the logic here is:</p>
  
  <blockquote>
    <ol>
    <li>Check the dropdown list and datepicker</li>
    <li>If they both contain item in it &amp; item has been changed then enable
    the 'Save' button.</li>
    <li>Else, disable the button.</li>
    </ol>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code> function EnableSaveButton() {
      var tempDDL = jQuery("#testPopup SELECT");
      var tempText = jQuery("#testPopup INPUT:text");
      var buttons = jQuery("#testPopup INPUT:button");
  
      jQuery.each(buttons, function (i, buttonCtl) {
          if (buttonCtl.value.toLowerCase() == "save") {
              if ((tempDDL.find('OPTION:selected').val() !== "-1") &amp;&amp; (tempText.val() != ""))
                  buttonCtl.disabled = false;
              else
                  buttonCtl.disabled = true;
          }
      });
  }
  </code></pre>