title: Nested Forms with AJAX in .Net MVC
body: <p>Hi I have a form in which the Username field needs to be checked for availability using AJAX.
  Here is my code..</p>
  
  <pre><code> &lt;% using (Html.BeginForm()) { %&gt;
          &lt;%: Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") %&gt;
          &lt;div&gt;
              &lt;fieldset&gt;
                  &lt;legend&gt;Account Information&lt;/legend&gt;
  
                  &lt;div class="editor-label"&gt;
                      &lt;%: Html.LabelFor(m =&gt; m.UserName) %&gt;
                  &lt;/div&gt;
                  &lt;% using (Ajax.BeginForm("Checkavailability", new AjaxOptions { UpdateTargetId = "textEntered" }))
                     { %&gt;
   &lt;div class="editor-field"&gt;
                      &lt;%: Html.TextBoxFor(m =&gt; m.UserName) %&gt;
                      &lt;%: Html.ValidationMessageFor(m =&gt; m.UserName) %&gt;
                  &lt;/div&gt;
    &lt;input type="submit" value="Check Avail" id="Submitt"/&gt;&lt;br /&gt;
    &lt;span id="textEntered"&gt;Nothing Entered&lt;/span&gt;
  &lt;% } %&gt;
  
  
                  &lt;div class="editor-label"&gt;
                      &lt;%: Html.LabelFor(m =&gt; m.Email) %&gt;
                  &lt;/div&gt;
                  &lt;div class="editor-field"&gt;
                      &lt;%: Html.TextBoxFor(m =&gt; m.Email) %&gt;
                      &lt;%: Html.ValidationMessageFor(m =&gt; m.Email) %&gt;
                  &lt;/div&gt;
  
                  &lt;div class="editor-label"&gt;
                      &lt;%: Html.LabelFor(m =&gt; m.Password) %&gt;
                  &lt;/div&gt;
                  &lt;div class="editor-field"&gt;
                      &lt;%: Html.PasswordFor(m =&gt; m.Password) %&gt;
                      &lt;%: Html.ValidationMessageFor(m =&gt; m.Password) %&gt;
                  &lt;/div&gt;
  
                  &lt;div class="editor-label"&gt;
                      &lt;%: Html.LabelFor(m =&gt; m.ConfirmPassword) %&gt;
                  &lt;/div&gt;
                  &lt;div class="editor-field"&gt;
                      &lt;%: Html.PasswordFor(m =&gt; m.ConfirmPassword )%&gt;
                      &lt;%: Html.ValidationMessageFor(m =&gt; m.ConfirmPassword) %&gt;
                  &lt;/div&gt;
  
                  &lt;p&gt;
                      &lt;input type="submit" value="Register" /&gt;
                  &lt;/p&gt;
              &lt;/fieldset&gt;
          &lt;/div&gt;
      &lt;% } %&gt;
  </code></pre>
  
  <p>The problem is when I click on check avil button the validation appears.. Is there a way to submit just the ajax form and update without submitting the main form?? or any way to implement my check availability logic?</p>