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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:43:40+00:00 2026-06-06T01:43:40+00:00

I am using the jquery form plugin which uses jquery ajax to do most

  • 0

I am using the jquery form plugin which uses jquery ajax to do most of its work. We have jquery 1.7.2

We are using it to send a form via ajax to the server and either return a value indiciating success or return the form with validation errors.

I have it working in firefox and chrome when an error is found in validation the contents of a div containing the old form are replaced with the new one that has the errors.

$(‘#FormDiv’).empty().html(response);

The reponse would look something like the following:

<form action="/MyForm/Edit" id="MyForm" method="post"><input id="Id" name="Id" type="hidden" value="" />
    <input id="PlantId" name="PlantId" type="hidden" value="1" />
    <table>
        <tr><td class="field">
                ID
            </td>
            <td>
                <input class="required" id="MyId" name="MyName" type="text" value="JP001" />

            </td>
            <td class="field">Description</td>   
            <td><input class="required" id="Description" name="Description" type="text" value="" />
        </tr>
        <tr>
            <td class="field">Created by</td>
            <td>Joe Bloggs</td>
            <td class="field">Create date</td>
            <td>15/06/2012</td>
        </tr>
    </table>
</form>

Debugging in IE the I can see that the ajax call actually has this in its return body however the parameter to my method is removing the outer form starting and ending tags so essentially it is just a table.

I have tried a few different things to try and figure this out including setting processData to false (not sure if that would really affect it anyway) and setting the returnType to “text” and “html” but none really helped.

Any ideas?


So it turns out that if i wrap the form in a div everything seems to work ok, not quite sure whats going on there, if anyone can explain this they can have the answer

  • 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-06T01:43:41+00:00Added an answer on June 6, 2026 at 1:43 am

    It’s not a jQuery bug.

    It’s a not-so-well-known Javascript “feature”

    Apparently innerHTML in FF3 and IE6+ (And maybe others) don’t like form tags as part of innerHTML. If you want, you can test it:

    <div id="test">
       <form>
          <input>
       </form>
    </div>
    
    <script>
        window.onload=document.getElementById('test').innerHTML = "<form><input type="hidden" name="blah"></form>";
    </script>
    
    
    
    Result:
    
    <div id="test">
        <input type="hidden" name="blah">
    </div>
    

    Not quite sure why, but that is how they implement it.

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

Sidebar

Related Questions

I'm using the jQuery validation plugin and the form uses ajax to submit the
i'm using ajax form jquery plugin to submit a form (in a dialog) via
I'm using the jQuery plugin ajaxForm to submit a file upload form via AJAX.
I'm currently using the jquery-form-observe plugin which uses onbeforeunload to prompt the user about
I send asynchronous call using jQuery form plugin and in the case of success
I am using jquery validation plugin for form validation. I have added a custom
I have formatted my form using uniform jquery plugin. Also for submitting the form
I'm using the jquery form plugin ( http://malsup.com/jquery/form/ ) to upload a file via
I am using jquery validation plugin to validate my form. I have one field
I have a form that is using jQuery Validate plugin for client side validation,

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.