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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:47:26+00:00 2026-06-05T05:47:26+00:00

I have the following problem: When the user wants to increase the number of

  • 0

I have the following problem:

When the user wants to increase the number of movies you want to buy the first thing I do is send by jQuery.ajax the ID of the movie and this comes to a php function to UPDATE, then in the same function performed a SELECT to get the price running total, then returns the value in the variable totalpricemovie, I want that value to be placed in the last column of the table that says TOTAL, but not how: S

This is my window
Shopping window

jQuery code to send ID movie to Update and retrieve totalprice for update in column total TOTAL($)

$('.quantitymovie').live('change',function() {
        claveMovie = $(this).attr('id');

        updateQuantityMovie = {
            idmovie : claveMovie,
            tag : 'updateQuantity'
        };

        $.ajax({
            type: "POST",
            url: "./php/processFunctions.php",
            data: updateQuantityMovie,
            success: function(response) {

                if(success.response == 'success') {

                    //put update price of a movie in last td of column called Total($)
                } else {
                    alert ("Error al actualizar la cantidad de películas");
                }
            }
        });
         return false;
    });

I think it has to do something like taking the index of the row and then find the last cell to be placed there which contains the variable totalpricemovie.

HTML CODE TABLE

<div id="checkOutModal">
    <fielset>
    <legend>Datos de compra</legend>
    <form id="formCheckout" name="checkOut" method="POST" action="php/processFunctions.php">
        <table id="orderCheckout">
            <th scope="col">Películas</th>
            <th scope="col">Precio ($)</th>
            <th scope="col">Cantidad</th>
            <th scope="col">Total ($)</th>
        </table>
        <p>
        <label for="nombreCliente">Nombre completo</label>
        <input id="nombreCliente" class="required onlyLetter" name="nombreCliente" type="text"/>
        </p>
        <p>
        <label for="direccionCliente">Dirección</label>
        <input id="direccionCliente" class="required" name="direccionCliente" type="text"/>
        </p>
        <p>
        <label for="emailCliente">Correo electrónico</label>
        <input id="emailCliente" class="required" name="emailCliente" type="text"/>
        </p>
        <input id="finalizarCompra" name="finalizarCompra" type="submit" value="Finalizar"/> 
        <a href="#" id="contShopping">Seguir Comprando</a>
    </form>
    </fieldset>
</div>

Note: The content of a table are generate with another function in jquery.ajax()

  • 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-05T05:47:28+00:00Added an answer on June 5, 2026 at 5:47 am

    Something along these lines should work for you. If you give us your html, I could give you a more specific answer.

    $('#' + claveMovie).parent('td').next('td').html(response.totalpricemovie);
    

    This code will get the parent td of your control, traverse the dom to the next td, then set the html of that td to your new total.

    Edit:

    You already know the id of the control that has been changed.

    $('.quantitymovie').live('change',function() {
            // The id of the movie changed
            claveMovie = $(this).attr('id');
    
            updateQuantityMovie = {
                idmovie : claveMovie,
                tag : 'updateQuantity'
            };
    
            $.ajax({
                type: "POST",
                url: "./php/processFunctions.php",
                data: updateQuantityMovie,
                success: function(response) {
                    if(success.response == 'success') {
                        $('#' + claveMovie).parent('td').next('td').html(response.totalpricemovie);
                    } else {
                        alert ("Error al actualizar la cantidad de películas");
                    }
                }
            });
    
            return false;
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem: I have a search box in which user can
I have the following problem: I have an Activity where a user can start
I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User
Ive got the following problem. I have a model called user which has a
I am using GWT/JAVA for development. I have following problem: I want to remove
I have following problem: I have to make a ASP.NET Webapplication with a two-row
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
Hi i have following Problem. I write a Mediawiki Extension where i need some
I have the following problem. I have embedded a map using Google Maps' API.

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.