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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:08:00+00:00 2026-06-16T01:08:00+00:00

I have a table for adding a new budget details like the image below:

  • 0

I have a table for adding a new budget details like the image below:

enter image description here

When I select an Income Account then another row is added to the viewmodel collection:

enter image description here

I want to set all field values to “0.00” when the new row is added and also I have a problem because if I delete a row then the “change” event of the combo doesnt exist so there is no way to add a new row when changing the last combo.

Any clue? Here is the fiddle working sample: http://jsfiddle.net/rLUyS/9/

Here is the code that I use to bind the change action to the last added combo:

$('select[name=cboincomeaccount_' + newRowIndex + ']').bind("change", {
    combo: $(this)
}, handler);

function handler(event) {

    newRowIndex++;
    var combo = jQuery(this);
    var row = combo.parent().parent();

    appViewModel.addRow();

    // Unbind
    combo.unbind('change');
    // Bind new combo
    jQuery('select[name=cboincomeaccount_' + newRowIndex + ']').bind("change", {
        combo: jQuery(this)
    }, handler)

    jQuery(row).find('input[name^="txtincmonth"]').removeAttr('disabled');    
};

Thanks in advance!!

  • 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-16T01:08:02+00:00Added an answer on June 16, 2026 at 1:08 am

    This might not be so much of a Knockout issue as it is a user interface issue.

    I want to set all field values to “0.00” when the new row is added

    Well that’s easy enough. Simply initialize the the observable row to all zeros.

    When I select an Income Account then another row is added to the viewmodel collection…
    and also I have a problem because if I delete a row then the “change” event of the combo doesnt exist so there is no way to add a new row when changing the last combo.

    This is probably a negotiable requirement.

    Why not create an ‘Add’ button instead of insisting on this “nifty” behavior that adds a row when the user makes a section in the dropdown list?

    Besides, even if we could accomplish what you’re asking for (and I can envision a way that we could do this), what will you do when it’s time to save the user’s input to the server? Were you planning on ignore that last empty row?

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

Sidebar

Related Questions

I have a table, in which I am adding new rows. After 6 rows
I have a table tag on my page. I'm adding dynamically a new set
I have a table called newDataTable where I am adding new rows dynamically with
i have table with 4 rows and when i click on any row then
Currently have a table .. and need to start adding new data columns to
I have a table view that I am customizing and I am adding a
So I have a table layout that Im adding rows to through code since
I have a MyISAM table with more than 10^7 rows. When adding data to
I have 2 ways of adding images to a table and, which is most
I am trying to alter a table with adding a new column setting 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.