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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:50:34+00:00 2026-06-08T10:50:34+00:00

I’m setting up a cart where the user can update the quantity. Because I

  • 0

I’m setting up a cart where the user can update the quantity. Because I don’t know aJAX to do it instantly, I’m looking to do it in full php with a refresh cart. ( you can still se my post where I try to set it up with AJAX)

The thing is that there is a form below the cart and when the user change the quantity (into an input) he has to click on ‘refresh’ or ‘recalculate’, whatever.

So my problem is I get the validation process running as the re-calculate is like a submit button ( the price is calculated at the begining of the form method) because the user modified an input, and for all the fields that has not been filled yet, I got an error.

How can I say “If the user click on refresh, don’t submit the form to the validation process, just take that input in consideration” ? I don’t know if it is possible to have 2 separated forms on the same page ? (they are inside each other)

By the Way, I’m using codeIgniter.

I give a part of my form, I need to listen to the

form_dropdown('quantity'.$product['title'],$options,$value[$product['title']],$data0);

when I want to update the quantity, and only this one.

<ul class="form">
    <li>
        <h2>Your Information</h2>
    </li>
    <li>
        <ul class="form" id="threeColumns">
            <li>
                <?php
                echo form_open('main/Form');

                echo form_label('First Name', 'firstname');
                echo ' :</br>';
                if (set_value('firstname')) {
                    $valuefirstname = set_value('firstname');
                } else {
                    $valuefirstname = $this->session->userdata('firstname');
                }
                echo form_input('firstname', $valuefirstname);
                echo form_error('firstname');

                echo '</li><li>';

                echo form_label('Last Name', 'lastname');
                echo ' :</br>';
                if (set_value('firstname')) {
                    $valuelastname = set_value('lastname');
                } else {
                    $valuelastname = $this->session->userdata('lastname');
                }
                echo form_input('lastname', $valuelastname);
                echo form_error('lastname');

                echo '</li><li>';

                echo form_label('Email', 'email');
                echo ' :</br>';
                if (set_value('firstname')) {
                    $valueemail = set_value('email');
                } else {
                    $valueemail = $this->session->userdata('email');
                }
                echo form_input('email', $valueemail);
                echo form_error('email');
                ?>
                <div class="fError Right">
                    <?php
                    if (ISSET($error) AND $error != NULL)
                        echo $error;
                    ?>
                </div>
            </li>
        </ul>
    </li>

    <div class="break">
    </div>

    <li id="Payment">
        <div id='Table'>
            <table>
                <tr>
                    <th id="top-left">
                        Product
                    </th>
                    <th>
                        Color
                    </th>
                    <th>
                        Quantity
                    </th>
                    <th>
                        Price Per Product
                    </th>
                    <th id= "top-right">
                        Total
                    </th>
                </tr>
                <?php foreach ($products as $product) { ?>
                    <tr class="line">
                        <td>
                            <img id="tableImage" src="<?php echo base_url($product['image_url']) ?>" alt="product" width="121"  />
                        </td>
                        <td>
                            <?php echo $product['title'] ?>
                        </td>
                        <td>
                            <?php
                            $options = array(
                                '0' => '0',
                                '1' => '1',
                                '2' => '2',
                                '3' => '3',
                                '4' => '4',
                                '5' => '5',
                                '6' => '6',
                                '7' => '7',
                            );

                            if ($product['quantity'] == 0) {
                                $value[$product['title']] = set_value('quantity' . $product['title']);
                            } else {
                                $value[$product['title']] = $product['quantity'];
                            }
                            $data0 = 'class="quantSelect" value="' . $value[$product['title']] . '" id="quant' . $product['title'] . '"';

                            echo form_dropdown('quantity' . $product['title'], $options, $value[$product['title']], $data0);
                            ?>
                        </td>
                        <td>
                            <?php echo $product['price'] ?>
                        </td>
                        <td id="<?php echo 'price' . $product['title'] ?>">
                            $<?php echo $total[$product['title']] ?>
                        </td>
                    </tr>
                    <?php } ?>

Thanks

  • 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-08T10:50:36+00:00Added an answer on June 8, 2026 at 10:50 am

    A simple way is to have two rulesets for your form. One is with all the fields and ‘required’. The other is the same rules, but no ‘required’

    Then if refresh, run form validation with no ‘required’

    If submit, run form validation with the required ruleset.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.