title: Form validation in jsp page using JavaScript
body: <p>i am using jsp for registration form. I use servlet for verification of existing username. how can i write client side validation code in javasript.
  My registration form is</p>
  
  <pre><code>&lt;form action="Registration" method="post" name="registration" &gt;
  &lt;table&gt;
     &lt;tr&gt;
      &lt;td&gt;Name&lt;/td&gt;
      &lt;td&gt;:&lt;input type="text" name="name" value="" placeholder="Name"    
  class="input_Name"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Place&lt;/td&gt;
      &lt;td&gt;:&lt;input type="text" name="place" value="" placeholder="Place"    
  class="input_Place"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Gender&lt;/td&gt;
      &lt;td&gt;:&lt;input type="radio" value="male" name="gender"&gt;Male
      &lt;input type="radio" value="female" name="gender"&gt;Female&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;UserName&lt;/td&gt;
      &lt;td&gt;:&lt;input type="text" name="username" value="" placeholder="UserName" 
    class="input_UserName"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Password&lt;/td&gt;
      &lt;td&gt;:&lt;input type="password" name="password" value="" placeholder="Password" 
   class="input_Password"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;Confirm sword&lt;/td&gt;
      &lt;td&gt;:&lt;input type="password" name="password" value="" placeholder="re-
   Password" class="input_re-Password"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" value="submit" &gt;&lt;/td&gt;
  &lt;/tr&gt;
   &lt;/table&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>thank you..</p>