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

  • Home
  • SEARCH
  • 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 6560677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:29:28+00:00 2026-05-25T13:29:28+00:00

I have this form: @using (Html.BeginForm(Update, MyController, FormMethod.Post, new { id = frmEdit }))

  • 0

I have this form:

@using (Html.BeginForm("Update", "MyController", FormMethod.Post, new { id = "frmEdit" })) {
<input type="text" id="Title" value="Adam" />
}

Here is the jquery:

  $(function () {
        $('#frmEdit').submit(function () {
            //read form values            
            //verify req fields
            if (isValid) {
                $.ajax({
                    url: this.action,
                    type: this.method,
                    data: $(this).serialize(),
                    beforeSend: SpinWheel(l),
                    success: function (result) {
                        if (result.s == 'OK') {
                            alert("Success Updated");                                                    
                        }
                        else {
                            Alert("Sorry! Update failed.");
                        }
                    },
                    error: function (xhr, status, error) { alert('Error');}
                });
            }
            return false;
        });

    });    

Controller:

public ActionResult Update(FormCollection album)
{
   return Json(new { s = "OK" });
}

The form has a modal inside it. When I click a link in parent page, the modal is launched.
In the modal I have the form with a submit button.

  • 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-25T13:29:29+00:00Added an answer on May 25, 2026 at 1:29 pm

    Try adding a call to preventDefault() on the event passed in:

    $('#frmEdit').submit(function (e) {
        e.preventDefault();
    
        ....
    });
    

    bad copy/paste? alert(Error');

    If so, this could be the reason it wasn’t hitting the return false; at the end of your submit event

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

Sidebar

Related Questions

I have a simple form created using Ajax.BeginForm : <% using (Ajax.BeginForm(Update, Description, new
I have this code for Form Submit.. <input type=submit runat=server id=buttonSubmit value=Add style=width:100px; />
<%using (Html.BeginForm(OrderDevice, ImportXML, FormMethod.Post)) { %> <table id=OrderDevices class=data-table> <tr> <th> DeviceId </th> <th>
I have this code in the View: <script src=../../Scripts/jquery.form.js type=text/javascript></script> <script src=../../Scripts/jquery-1.5.1.js type=text/javascript></script> <script
I have an URL: /Account.aspx/Confirm/34a1418b-4ff3-4237-9c0b-9d0235909d76 and a form: <% using (Html.BeginForm()) { %> <fieldset>
I have this : HTML : form + jquery Controller I post the form
I have form @using (Html.BeginForm(Create, StoreManager)) { @Html.ValidationSummary(true) //etc.. } User uploads images to
i'm using the following post type: <% using (Html.BeginForm()) { %> <%= Html.Hidden(EligiblePages, Model.EligiblePages)
I am using C# with a Windows Application Form. In this I have a
this is a simple question. I have a form that is being validated using

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.