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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:17:35+00:00 2026-05-11T19:17:35+00:00

Having a bit of a hairy issue when submitting data over a jquery ajax

  • 0

Having a bit of a hairy issue when submitting data over a jquery ajax call. Basically, form values of form fields which have been dynamically added to the screen into a tubular grid using jquery are not updating on a batch save command.

Basically I have a grid listing which displays all current rows saved to the database with each column containing form fields. I then have a form at the top of the page, which is your typical add another detail form. You type your values, press “add” this is saved to the database via a jquery json ajax call, and your form data is added and reflected in a new row in the listings table. (this part works)

My problem lies with when you wish to change the form values within the newly added jquery table row. When the save button is pressed, only any of the already built table row’s will be re-saved. Your dynamic row form data does not save. The update call uses jquery ajax and ASP.NET MVC model binding. On the “add” I am returning an asp.net mvc “partial view” to my jquery ajax response and it is being added to a grid listing table using $("#tablename tr:last").after(result).

What I have deduced already is, as said, the new dynamically added row does not update. I have an IList<Item> set returned in my MVC model binding list to my controller action method which contains the entire list of items, minus the newly created jquery dynamic-added form field rows. This is the problem and why when you perform a page refresh, the rows are back to the original form values entered on initial add.

Any ideas why my IList<Item>‘s would not include these dynamically added rows? Inspecting in Firebug they use the same naming convent in their name attribute and all should be fine.

Graham.

Update 1 May 11:00 GMT+10: I do receive the values when changing the Model Binding from IList to FormCollection. I do not want to have to use FormCollection rather than model binding, but it begs the question if I can get it correctly through FormCol, why not IList model binder? I have compared the array entry to a working item, and they all fit the same criteria and values.

  • 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-11T19:17:35+00:00Added an answer on May 11, 2026 at 7:17 pm

    I’m not an ASP programmer, but I do a heck of a lot of jquery work. If I understand your problem correctly, your dynamically generated rows are not being bound to the callback functions that will perform your update operations.

    You can bind the dynamically generated elements to a callback by either using the jQuery ‘live’ function (as Wikidkaka was trying to tell you) or you can bind the newly created elements manually in the callback function that is fired when the ajax call returns.

    I would recommend using the native live function that was added in (I believe) the latest release of jQuery. It will save you from having to write additional lines to manually bind the callbacks and makes code maintenance easier.

    So change:

    $('div.your-save-buttons').click(updateFunction);
    

    to

    $('div.your-save-buttons').live(updateFunction);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having a bit of an issue with decoding data coming from a database.
I'm having a bit of trouble iterating and retrieving width() values. $(.MyClass).each( function ()
having a bit of trouble adding some data to a database. I have the
Having a bit of an issue with wordpress URLs, it seems to automatically add
I'm having bit of a trouble selecting correct values from my mysql sql server.
Coming from Win32, I am having bit of an issue or a problem trying
Having a bit of a problem with the AJAX Accordion Control... I have two
Having a bit of problem debugging my jQuery code... In order to allow hover
Having a bit of an issue here. I'm creating an application in Visual Studio
Having a bit of a drawing complication you would call it. My math is

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.