Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3399362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:45:43+00:00 2026-05-18T04:45:43+00:00

I have two submit buttons on a page using MVC 3 with client-side validation.

  • 0

I have two submit buttons on a page using MVC 3 with client-side validation. There’s a text box that is mapped to an object that has data annotations that make it required. As long as I’m trying to click the Save button it works fine. It ensures that the textbox is filled-in.

However, when I try to click the Delete button to go back to the controller and bypass the client-side validation it of course only works if the textbox is filled in. I see this need for situations where there is a Cancel button as well.

I’m unable to find any examples on how to have a submit button that still posts back to the controller but also allow one of the submit buttons to not validate the page.

Here’s the markup:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% using (Html.BeginForm())
   {

%>
<fieldset>
    <br />
    <div class="grid_10">
        <div class="grid_2 fieldlabel alpha">
            <%= Html.LabelFor(model => model.Name)  %>
        </div>
        <div class="grid_8 omega" style="white-space: nowrap;">
            <%= Html.TextBoxFor(model => model.Name, new { @class = "focus textbox_300" }).MaxLength(100)%>
            <%= Html.ValidationMessageFor(model => model.Name) %>
        </div>
        <div class="clear">
        </div>
        <br />
    </div>
    <div class="clear">
    </div>
    <div class="grid_4 prefix_2">
        <input type="submit" value="Save" id="btnSave" name="btnSubmit" style="width:60px;" />
        &nbsp;&nbsp;
        <input type="submit" value="Delete" id="btnDelete" name="btnSubmit"  style="width:60px;" />
    </div>
    <div class="clear">
    </div>
    <br />
</fieldset>
<% } %>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:45:44+00:00Added an answer on May 18, 2026 at 4:45 am

    Are they posting to the same ActionMethod?

    You could put it into it’s own <form>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms, and so two different submit buttons, for one page (page
I have a page with two submit buttons at the bottom of the page.
I am trying to have two submit buttons in my form - one accepts
I have two simple submit buttons on my form, which work just fine: <button
I have two fields on my web page ie: BookAuthor and BookDescription.On submit,the page
I would like to have a form that can submit to two different action
i have a from with a submit button after using jquery the page will
I have a simple HTML page (ratings.html) that I'm trying to test using HtmlUnit.
I have two select lists that each display users and two buttons (add and
I have a form with two buttons, a submit button and a cancel/close button.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.