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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:10:48+00:00 2026-05-12T08:10:48+00:00

I have an ASP.NET MVC ajax form fully working on FireFox. Here’s how the

  • 0

I have an ASP.NET MVC ajax form fully working on FireFox. Here’s how the code looks like:


<% using (Ajax.BeginForm("SendMessage", "Contact", new AjaxOptions { OnComplete = "ProcessResult" })) { %>
<div id="inputArea">
    <label for="Name" class="contactLabel">Your Name:</label>
    <%= Html.TextBox("SenderName", Model.Contact.SenderName)%>
    <label for="Email" class="contactLabel">Your Email:</label>
    <%= Html.TextBox("Email", Model.Contact.Email)%>
    <label for="Subject" class="contactLabel">Subject:</label>
    <%= Html.TextBox("Subject", Model.Contact.Subject)%>
    <label for="Message" class="contactLabel">Message:</label>
    <%= Html.TextArea("Message", Model.Contact.Message)%>
</div>
<input type="submit" value="Send" id="submitButton" onclick="allowSubmit(false);" />
<span id="operationMessage"></span>

There are two additional javascripts, one for disabling the submit button (letting user pressing it only once) and the other is for processing of the server result:


    function ProcessResult(content) {

        var json = content.get_response().get_object();
        var result = eval(json);

        $("#operationMessage > span").empty();
        $("#operationMessage > ul").empty();
        $(':input').removeClass('input-validation-error');

        if (result.Successfull) {
            $('#operationMessage').append('<span><br>' + result.Message + '</span>')
                                  .removeClass('error')
                                  .addClass('success');
        }
        else {

            $('#operationMessage').append('<span><br>' + result.Message + '')
                                  .removeClass('success')
                                  .addClass('error');

            for (var err in result.Errors) {
                var propertyName = result.Errors[err].PropertyName;
                var errorMessage = result.Errors[err].Error;
                var message = propertyName + ' ' + errorMessage;

                $('#' + propertyName).addClass('input-validation-error');
                $('#operationMessage > ul').append('<li># ' + message + '</li>');
            }
        }

        allowSubmit(true);
    }

    function allowSubmit(enabled) {
        if (!enabled) {
            $('#submitButton').attr('disabled', 'disabled');
        }
        else {
            $('#submitButton').removeAttr('disabled');
        }
    }

I got it all working on FireFox, but as I was testing it on IE, it didn’t work. As soon as I pressed send button on IE, it disabled (correctly) but there was no server call, meaning server function on MVC controller was never called.

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-05-12T08:10:48+00:00Added an answer on May 12, 2026 at 8:10 am

    Okay…found out what the problem is, but why the different behavior between IE and FF…
    if you disable the SUBMIT button on ONCLICK event, the whole server call won’t happen on IE (while it does on FF). so, simply by removing the onclick event handler on the page, it worked.

    • 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 ajax form in asp.net mvc which is as simple as this:
I am new to ASP.NET MVC, particularly ajax operations. I have a form with
I have the following view definition in my asp.net mvc website: <% Using Ajax.BeginForm(UsrCtlChangePassword,
I am developing a site using asp.net MVC. I have used AJAX for paging,sorting
I have ajax code for asp.net (non-mvc) to call to a webMethod to get
Using ASP.Net MVC 1.0 I have a form with some input control on it.
ASP.Net MVC 3 using C# I currently have a form with some dropdown lists
I'm using asp.net mvc 3 with unobtrusive jquery validation. I have a form that
Inside of an asp.net mvc partial view, I have an Ajax form that posts

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.