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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:23:16+00:00 2026-06-09T23:23:16+00:00

I have an order form that is quite complex where you can order products

  • 0

I have an order form that is quite complex where you can order products form radio buttons.

I also have a text box where the price gets calculated live on the page depeding on what you are selecting.

This is done by using this script

<script type="text/javascript">
 jQuery(document).ready(function($){
var frm = document.forms.myForm;
frm.onchange = function(e) {
    var tot = 0;
    for( var i = 0, l = frm.elements.length; i < l; i++ ) {
        if( frm.elements[i].checked ) {
            tot += parseFloat( frm.elements[i].getAttribute('data-price') );
        }  
    }
    document.getElementById('total').value = ( tot.toFixed(2) );
}
})
    </script>

The box is here

<input id="total" name="total2" class="total-box" type="text">

But for some reason the info is not being added into the mail that gets sent, everything else gets sent fine.

In my mail script I have

$total2 = $_REQUEST['total2'] ;

and

<tr><td style="border-bottom:1px solid #7e7e7e;">Price</td><td style="border-bottom:1px solid #7e7e7e;">'.$total2.' </td></tr>

Any Ideas?

  • 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-09T23:23:17+00:00Added an answer on June 9, 2026 at 11:23 pm

    If you use javascript the value of the input field will not be set for the server $_POST data. So you are looking for some kind of serialization (i.e javascript that takes all the input values and sends them through $_POST, you could do it manually but its tedious)

    If you want to stick to pure javascript: http://code.google.com/p/form-serialize/ might help out. Otherwise look at some framework and serialize(), most frameworks have it implemented as it is used quite often.

    My suggestion would be to recreate your price generation script in PHP aswel, so you just submit which form buttons have been pressed (which you don’t need serialize for) and then just get the price from that on the backend. A lot safer too!

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

Sidebar

Related Questions

I have an order form with about 30 text fields that contain numerical values.
I have inherited a project, that provides an order form to a customer. The
I have an MDI parent form that may open a child form called Order.
I currently have a macro that uses a form in order to perform some
I have a multi-step order form built in this manner: Step 1: Choose category
I have a registration form and used fieldset to order the input fields in
I have a perplexing issue that I can't seem to comprehend... I have two
I have written a couple of web sites that contain a contact us form.
I have quite a fundamental problem that none of my selenium phpunit tests pass
I have a list of order numbers. From my service order view, I can

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.