title: ASP.NET Client-side validation on textbox without postback
body: <p>I am using ASP.NET and would like to do the following on client side because I do not want the page to reload (do not want postback). I would like to check for user input with following conditions:</p>
  
  <ol>
  <li>There are 2 radiobuttons and 2 textboxes and 1 button. Something like this:
  <img src="https://i.stack.imgur.com/gxLxL.png" alt="enter image description here"></li>
  <li>User must tick the radiobutton in order to activate the textbox (textboxes by default is disabled)</li>
  <li>If user tick radiobutton 1, textbox1 will be activated and textbox2 will be empty and disabled, if user press the button and textbox1 is empty message1 will activate.</li>
  <li>Same goes to the second radiobutton and textbox2.</li>
  </ol>
  
  <h2>Edit</h2>
  
  <p>I noticed that my button is in <code>&lt;asp:button&gt;</code> and not <code>&lt;input type="submit&gt;</code> therefore it will run my code behind to valdiate at server. Correct me if I am wrong. So how do I make my <code>&lt;asp:button&gt;</code> to validate user input without have to pass to server? </p>