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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:56:02+00:00 2026-06-06T08:56:02+00:00

FINAL EDIT: After following the answer from Darin Dimitrov, I have found that the

  • 0

FINAL EDIT:

After following the answer from Darin Dimitrov, I have found that the problem ended up being that the AJAX call to the Controller’s method UpdateForm() was returning an empty string. This was a modification that I found necessary some time ago after experiencing a different problem. Passing an empty string was causing Firefox’s parser to choke (while Chrome and IE didn’t care, apparently) so I replaced the empty string with an empty div.

Edit:

Thanks to Darin Dimitrov’s suggestions below, I have found that the reason I was having trouble is due to an error being thrown whenever the form in question is being submitted.

JQuery Error

The error reads “Node cannot be inserted at the specified point in the heirarchy”. This is thrown each and every time the form is submitted. I noticed in the POST data that it seems to think this is an XMLHttpRequest. Is that the cause (the AJAX request in question is just returning HTML)? Here is the POST data from Firebug:

POST Data 1

POST Data 2

POST Data 3

This error reads “XML Parsing Error — No Element Found”.

FYI – the HTML being returned is always an empty string…


I have an MVC3 application running on IIS7. In one of my views, I have a form being built using a Microsoft HTML helper function:

@using (Ajax.BeginForm("UpdateForm", new AjaxOptions { UpdateTargetId = "TargetDiv", InsertionMode = InsertionMode.InsertAfter, OnSuccess = "ClearTextBox" }))
{
    @Html.TextArea("txtInput", new { id = "txtInput", cols = "20", rows = "5", wrap = "virtual" })
    <input id="send" class="button" type="submit" value="Send"/><br />
} 

This generates the following HTML when the Controller provides this view:

<form action="/RootName/ControllerName/UpdateForm" data-ajax="true" data-ajax-mode="after" data-ajax-success="ClearTextBox" data-ajax-update="#TargetDiv" id="form0" method="post">
     <textarea cols="20" id="txtInput" name="txtInput" rows="5" wrap="virtual"></textarea>    
     <input id="send" class="button" type="submit" value="Send"><br>
</form>

What I’m basically trying to do here is take the text inside the TextArea called txtInput and append it to the end of the Div called TargetDiv whenever the Send button above is clicked and clear out the text from txtInput after the appending is complete by means of the ClearTextBox() method (Javascript). The append always works in every browser; and when I run in Internet Explorer or Chrome, the clearing of the text works just fine. However, Firefox doesn’t seem to want to call the ClearTextBox() method.

Is Firefox not compatible with this data-ajax-success option in the form signature?


Things I’ve Tried

I found this guy:
Ajax.BeginForm doesn't call onSuccess

The solution is to add this script:

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>

I am calling this script:

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>

…but I tried swapping it out just in case. No joy.

I was asked to try changing the method call to include parentheses by some folks in the C# chat room so that the HTML came out like this:

<form action="/WebChat/TMWC/UpdateForm" data-ajax="true" data-ajax-mode="after" data-ajax-success="ClearTextBox()" data-ajax-update="#chatText" id="form0" method="post">
     <textarea cols="20" id="txtInput" name="txtInput" rows="5" wrap="virtual"></textarea>    
     <input id="send" class="button" type="submit" value="Send"><br>
</form>

But that didn’t help.

The folks in C# Chat also suggested I replace the Javascript call with an alert – something like this:

<form action="/WebChat/TMWC/UpdateForm" data-ajax="true" data-ajax-mode="after" data-ajax-success="alert('yo!')" data-ajax-update="#chatText" id="form0" method="post">
     <textarea cols="20" id="txtInput" name="txtInput" rows="5" wrap="virtual"></textarea>    
     <input id="send" class="button" type="submit" value="Send"><br>
</form>

While Chrome pops the message box, Firefox does not!

  • 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-06T08:56:03+00:00Added an answer on June 6, 2026 at 8:56 am

    Status no repro in a newly created ASP.NET MVC 3 application.

    Controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult UpdateForm()
        {
            return Content(DateTime.Now.ToLongTimeString());
        }
    }
    

    View (~/Views/Home/Index.cshtml):

    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
    <script type="text/javascript">
        function ClearTextBox() {
            $('textarea').val(''); 
        }
    </script>
    
    <form action="/Home/UpdateForm" data-ajax="true" data-ajax-mode="after" data-ajax-success="ClearTextBox" data-ajax-update="#TargetDiv" id="form0" method="post">
         <textarea cols="20" id="txtInput" name="txtInput" rows="5" wrap="virtual"></textarea>    
         <input id="send" class="button" type="submit" value="Send"><br>
    </form>
    
    <div id="TargetDiv"></div>
    

    Works perfectly fine in Chrome, FF and IE.

    Also you might want to ensure that the Content-Type response HTTP header matches the actual response that you are sending. For example I have seen so many people send the application/json response header with some invalid JSON in the response body which produces the more sensitive parsers to choke.

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

Sidebar

Related Questions

I have a variable that is not supposed to change its value after it's
I have the following code: import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.util.Locale; public final class
I have a few some strange issues with my class after migrating from JDK5/Tomcat5
I have the following string: public static final String UPDATESONG = update songs SET
EDIT: After taking adivce I have rearranged the parameters & types. But the application
I have a problem with hashCode() that delegates to uninitialized objects using hibernate. My
I have a JCEKS keystore that I am loading from a war file as
While making some final tests of a class-library that I'm writing for Windows Mobile
Hi I am following the code from this link: Capture and log the response
I have the following prepared query I am using with mysql and php. It

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.