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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:29:20+00:00 2026-06-05T04:29:20+00:00

in a asp.net web application, I am using AJAX to submit a form. I

  • 0

in a asp.net web application, I am using AJAX to submit a form.
I want to run a javascript code before submitting it.
So I did this:

@using (Ajax.BeginForm("SaveProductDetails", "Store", new AjaxOptions
{
HttpMethod = "Post",
LoadingElementId = "progress",
OnBegin = "BeforeSubmit()",
OnSuccess = "closeMe()",
OnFailure = "doAlert('An error occurred while trying to save your changes. Please contact your Administrator')"
}))

But the problem is that After running the BeforeSubmit() function the submit is stopping. the form is not submitting.

There is no problems with the BeforeSubmit() function.
If I dont do anything with the OnBegin, the form submits properly.
Any help is greatly Appreciated.

  • 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-06-05T04:29:23+00:00Added an answer on June 5, 2026 at 4:29 am

    You can do something like below.

    View code

        @using (Html.BeginForm("ActionName", "ControllerName", FormMethod.Post, new { @id = "frmId", @name = "frmId" }))
        {
                @*Your code*@
                @*You have to define input as a type button not as a sumit. *@            
                <input value="Submit" type="button" id="btnSubmit" onclick="ValidateUser()" />
        }
    
        <script type="text/javascript">
    
        function ValidateUser() {
        // Do your verification here.
        $("#frmId").submit();
        }
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using AJAX-enable web services in my ASP.NET MVC3 application and I want
Now, I have a web application made using [html, asp.net, sql server,javascript & ajax].
I am building a AJAX intensive web application (using ASP.NET, JQuery, and WCF web
I am using the ASP.NET AJAX TabContainer control in a web application. I've placed
I'm developing a web application using .net/c#/jQuery. I want to develop an AJAX function
How to call WebService (using AJAX) if I created ASP.NET Web Application template. Every
I am developing web-application using Google Maps API and ASP.NET Ajax. Here is my
I'm using the ASP.NET MVC in my web application. It uses AJAX (MicrosoftAjax.js, MicrosoftMvcAjax.js,
I maintain a legacy ASP.Net Web application (using .Net 2.0 + SQL Server 2005
I ran into this dilemma when working on an ASP.net web application using Web

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.