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 875993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:21:41+00:00 2026-05-15T11:21:41+00:00

I have an ASP.NET MVC 2 form that is working perfectly, doing client side

  • 0

I have an ASP.NET MVC 2 form that is working perfectly, doing client side validation (using Data Annotations). Whenever users click on the submit button, client side validation kicks in before the form is actually posted back to the server.

This is the actual code, really basic stuff:

<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) { %>
    <%= Html.ValidationSummary(true) %>
    <%: Html.EditorForModel() %>
    <p>
        <input type="submit" value="Save" />
    </p>
<% } %>

Now here is my problem: I want to submit the form using a button that is not inside the < FORM > < /FORM > like the one in the sample above. This button needs to be placed inside a separate < DIV > on the page that works like a toolbar for all buttons and actions in my application.

I’m able to submit the form using something like this (using jQuery):

<asp:Content ID="Content2" ContentPlaceHolderID="ToolBarContent" runat="server">
    <input type="submit" value="Save" onclick="$('#form0').submit();" />
</asp:Content>

The only problem is that this will not trigger the client side validation, as if the user was clicking in the normal submit button. The whole form is posted back, server side validation is performed and the view is rendered again showing the validation errors.

I don’t want to have this regular submit button together with the form, just need to have this one in the toolbar, so is there a way to accomplish this? Having a separate button call the submit of the form while still triggering client side validation for the form?

  • 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-15T11:21:41+00:00Added an answer on May 15, 2026 at 11:21 am

    Try this hack:

    <input type="submit" value="Save" onclick="$('#dummy').click();" />
    

    where dummy is a hidden submit button inside your form.

    Also the Save button doesn’t need to be a submit button if it is not placed inside a form.

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

Sidebar

Related Questions

I have a form that collects a data using ASP.NET MVC. It looks like
I have an ASP.NET MVC form that when submitted can return either an ActionResult
I have an ASP.NET MVC form laid out something like this: @using (Html.BeginForm(null, null,
I am using ASP.NET MVC 1.0. I have an ActionResult which receives a form
Greetings! I'm doing a Form on ASP.NET MVC 2, in my view I have
I'm trying to get client validation working on my asp.net mvc 2 web application
I am working on rendering a dynamic form in an ASP.NET MVC view that
So, I'm working on a new project using ASP.NET MVC. Honestly I don't have
I'm working on an ASP.NET MVC app (using MVC3 RC2). Say I have 2
I'm using ASP.NET MVC. So I have a form on my page: <form id=MyForm

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.