title: How to get focus on a single textbox except on some conditions?
body: <p>I want to set the focus in a single textbox and some text must be entered in the textbox to move the focus out of it. But there is an exception that I should be able click on the buttons on the page without any entry in that textbox.</p>
  
  <p>Here is what I have done using JavaScript...</p>
  
  <pre><code>          function Validate() {
                var field1 = document.getElementById('&lt;%=textbox.ClientID %&gt;').value;
  
                if (field1 == "") {
                    alert("Please Enter some value");
                    document.getElementById('&lt;%=textbox.ClientID %&gt;').focus();
                    return false;
                }
                else {
                    return true;
                }
            }
  </code></pre>
  
  <p>And I have called it like...</p>
  
  <pre><code>          onblur="return Validate();"
  </code></pre>