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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:31:10+00:00 2026-06-01T13:31:10+00:00

I have a cart on my website and I need to let users easily

  • 0

I have a cart on my website and I need to let users easily change the quantity of items they have in their cart at a moment.

Here is the javascript code I have so far:

<script type="text/javascript" language="javascript">
    $(document).ready(function () {

        var items = [];

        $(".item").each(function () {
            var productKey = $(this).find("input[type='hidden']").val();
            var productQuantity = $(this).find("input[type='text']").val();
            items.addKey(productKey, productQuantity); ?
        });

        // 1. Grab the values of each ammount input and it's productId.

        // 2. Send this dictionary of key pairs to a JSON action method.

        // 3. If results are OK, reload this page.
    });
</script>

The comments I wrote are just guidelines for me on how to proceed.

Is there a way to add a key/pair element to an array of sorts? I just need it to have a key and value. Nothing fancy.

I wrote in an addKey() method just for illustrative purposes to show what I want to accomplish.

  • 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-01T13:31:11+00:00Added an answer on June 1, 2026 at 1:31 pm
    items[productKey] = productQuantity;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a shopping cart in a website and I have my items(which
I'm building an ASP.Net website. I have a cart class which stores the items
I have a shopping website and I am using javascript to add items to
I have some accent issues in a shopping cart script. Here's a part of
I am using prestashop as the cart for my website. I have a problem;
I have a shopping cart website running classic ASP that needs help during the
I have a really simple e-commerce in my website. It's just a shopping cart,
I have a website that basically allows customers to build a cart with an
I have implemented simple shopping cart in a website. I save the cart and
I am working on a shopping cart website for a university project and need

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.