Quote:Hi, I have two forms in my view page. Both forms have few textboxes and submit button. All the textboxes have required field validation. My problem is ,on submit of first form, the second form texboxes are also getting validated. How can i solve this?
@using (Html.BeginForm("ResetUserNameAction", "User", FormMethod.Post, new { @id = "myform1" })) { @Html.AntiForgeryToken() <div id="usernamereset" class="row"> @Html.LabelFor(m => m.Email) @Html.TextBoxFor(m => m.Email) @Html.ValidationMessageFor(m => m.Email) <input type="submit" id="resetUserName" name="resetUserName" class="userForm-button" value="Reset UserName" /> </div> <br /> <br /> } @using (Html.BeginForm("ResetPasswordAction", "User", FormMethod.Post, new { @id = "myform2" })) { @Html.AntiForgeryToken() <div id="passwordreset" class="row"> @Html.LabelFor(m => m.UserName) @Html.TextBoxFor(m => m.UserName) @Html.ValidationMessageFor(m => m.UserName) @Html.LabelFor(m => m.Email) @Html.TextBoxFor(m => m.EmailPassword) @Html.ValidationMessageFor(m => m.EmailPassword) <input type="submit" id="resetPasswordSendMail" class="userForm-button" value="Send Email" /> </div> }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)