Subtracting Discount On Order Form?

Jan 3, 2011

I have a custom order form that will add up and show the total but I'm having trouble getting it to subtract the discount. What changes do I need to make to my javascript?

The form is here: [url]

This is the javascript I'm using which is also viewable in the source code of the above form:

Code JavaScript:

View 8 Replies


ADVERTISEMENT

Calculate, Discount Plus Other Cost?

Jan 26, 2011

I have tried to work on this code for the last 2 weeks, can not figure out what is wrong with my code,please have a look for me, it will greatly appreciated from me; here my details;I work on <script type="text/javascript" language="javascript"> from dreamweaver:)to set my code to calculate, different Fiji tour (4 options, choose 1 in options)Payment (4 options, choose 1 in options)The cost of tour - discount base on tour cost. (discount has 4 different calculate)Need to be alert if they not choose 1 in each type.Second cost if they choose to fly out , will cost plus $400 on top the above cost. This is an optional, so they don;t need to buy if they want.I have attached my code, please have a look,

View 19 Replies View Related

Checkbox Discount Selection?

Sep 21, 2010

'trying' to write a checkbox type calculator. How can I do something along the lines of,If 5 checkboxes are checked, apply a 2% discount to the total.I am by no means an expert in javascript. I found a bit of jQuery

Code:
$(document).ready(function() {
var total = 0;

[code].....

View 2 Replies View Related

Jquery :: Realtime Order Form - Change Form Elements Depending On Selection

Aug 25, 2010

I've been struggling trying to get a small order form to work the way I want it to. Here is a link to the live page: [URL] And here is the code in question:

[Code]...

I have two questions...

Question 1 How can I make this piece of script act a little smarter. Look at the order form, I'm catering for up to 4 people and providing lunch for them. If they select 3 people and the spaghetti bol for lunch, it's only adding $10 where it should be adding $30. Obviously this is simple multiplication but since the values in my form are prices it makes it a little tricky. I'm guessing an onselect on the first part of the form which changes the pricing of the other items would be the way to go, but how do I do this?

Question 2 The "Total Price" is placed before the <form> tag by the script. This is ok but it's not where I want it. How can I position this text elsewhere in the document?

View 3 Replies View Related

Subtracting Won't Work ?

Dec 25, 2011

<html>

I don't see that x loses 10 what's the problem.

View 1 Replies View Related

Adding And Subtracting Total

Nov 12, 2009

How to subtract totalgift if my condition of donateamount is lesser than the totalgift trigger.

When the field is selected and the DonateAmount is trigger, I need to subtract the entered amount on the field selected to the TotalGift and put the field selected to zero "0" and TotalGift to original amount which is less than the amount entered on the field selected. I have some code that I created but it doesn't work. My initial javascript to calculate all the total is below assuming that DonateAmount is already selected = 25:

Below is what I am trying to do but it doesn't work. If the first input field is selected and user enter amount greater than the TotalGift, alert will pop-up then and the amount entered by the user automatically added to the TotalGift. So what I wanted to do is to subtract the amount entered to the TotalGift so it will go back to the original amount before the addition occurs. I know it is possible but I just can't get the right code.

My html code below which I have 18 input fields but all of them only optional wherever the user wants to input number. I will only include some here. Code below works, please ignore any missing code. I just need the calculation code to work.

View 2 Replies View Related

Subtracting Values In A For Loop?

Dec 7, 2011

I am having difficulty with creating a function that uses a For Loop to pull in two unknown variables and subtracting the first number from the second number. The subtraction occurs but I always get a negative number. This exact same function works correctly when adding but does not when I use it for subtracting to values. Here is what I have so far:

function calcDep1()
{
dblTotal = 0.0
for (i=8;i<=9;i++)

[Code]....

I have worked with it for several hours and also changed the equation to reflect dblTotal = dblTotal - dblValue but it still evaluates to a negative number. The two test values I used are 100 - 50 which should equal 50 but the answer always comes out to -150.

View 3 Replies View Related

Order Form Coding

Mar 13, 2006

I need advice about creating an order form (I was sent here from the General Web Building forum!) and I have been told that JavaScript is the way to go - can anybody help with the following (I know nothing about Javascript really).

I have an order form and plan to have the data emailed to me (I have FormMail script installed on my server). The form will have the following fields:

Reference Number
Size / Cost
Quantity
Grand Total

Clients will enter the ref no., choose a size/ cost (radio-button), and quantity (text box). I plan to accept details for about different items. I just want the total cost to be displayed in a box at the bottom before the form data is sent to me.

Can anybody point me in the right direction of how I might go about this? Tutorials / sample code etc.

View 8 Replies View Related

Auto Sum Order Form Modification

Jul 14, 2010

I needed to calculate my prices on-the-fly and display it in textbox with javascript. Well I did succeed with values of radio button an checbox, but as I know very little javascript, I don't know how to expand the code I got from here: [URL].

How can I make this happen: I have a textbox:
HTML Code:
<input type="text" name="podstranice" size="19" class="podstr" onkeyup="this.form.total.value=calculateTotal(this);">
And when a user inputs a number in it, javascript multiplies it with some other number, say 10 (its a price*quantity thing) and adds it to the total price along with data from checkboxes and radio buttons. And so, this is my javascript. It is basically identical to one on the link, but you can view it better this way I think.

Code:
// Calculate the total for items in the form which are selected.
function calculateTotal(inputItem) {
with (inputItem.form) {
// Process each of the different input types in the form.
if (inputItem.type == "radio") {
// Process radio buttons .....

View 1 Replies View Related

Create An Order Form For Page?

Apr 22, 2009

I need to create an order form for my page. I am new to javascript so I want to keep in basic.Its for parts (example (mouse pads, box of floppy disks, box DVD+R, A4 sheet 500 sheets)I want the scripts to perform the following:Display an order form for the user to fill out inside the form accept the user�s input for the number of each item they wish to purchase.validate their input and display an alert for any invalid data.display an alert when Check button pressed.display the values that were input and the final cost of the order.

Include input values from the form using the document.formname.variablename.value = construct use the onclick of your Check button to call your calculation function set the value of your final values using the this.form.variablename.value= construct

View 2 Replies View Related

Subtracting From Health Variable Using OnClick Function?

Apr 2, 2010

I'm trying to create a short, html/javascript mario text game. Now, in the beginning, he fights a goomba.

He has a health and energy number as variables:

And then, there will be different buttons for different attacks. However, the only one created is "Punch", with this code:

What would I put in the onClick function to make it subtract 4 health from the goomba and 2 health from Mario.

View 2 Replies View Related

Logic Error In AcroJS - Subtracting Instead Of Toggling

Feb 4, 2011

Putting some javascript into a pdf file and can't get this to work out right.

Basic setup:

Field X = checkbox;
Field Y = numeric input field;

Here's what should happen (increment is toggled):

Y has a value. When X is checked, Y is increased by 5. When X is unchecked, Y goes back to its original, unmodified value.

Here's what really happens (increment is subtracted):

Y has a value. When X is checked, Y is reduced by 5. When X is unchecked, Y is reduced by 5 again. Anytime X is clicked on, Y is reduced by 5 yet again.

Here's the code:

View 2 Replies View Related

Populating Order Form From Mysql Database

Oct 1, 2010

Am looking to find the easiest way to populate an order form that customers can email through to us.

I have created a database with 2 fields, id and name.

I would like to be able to have a form on my page with 3 fields, id name and qty.

I want to link the id and name fields on my form to my database so that when a customer starts to type a product id or description it will show a list of available matches. underneath which once clicked will populate the mssing field.

So for example is i have 2 products id 998 green apples and 999 red apples.

Typing in 999 in the id field of the form would populate the name field with red apples and typing red apples in the name field would populate the id field with 99.

if someone didn't know which apples they wanted they could type apples in the name field and underneath it would show both red and green which when clicked will populate both fields.

View 1 Replies View Related

Order Form With Text Fields And Totalling?

Apr 30, 2009

Ive been making a script for an order form, originally i had a drop down list of quantities, but having orders something of more than 500 leaflets at a time, is not good on a quantity list, the script below is what i have so far but cant understand why the sub total field at the bottom wont update, it worked fine with the list/menu.

<html>
<head>
<script language="javascript" type="text/javascript">

[code]....

View 2 Replies View Related

Adding Textbox To Auto-sum Order Form?

Jul 14, 2010

I am messing with this whole day, 'cos I wanted to try and figure this out by myself instead of going on forums.I failed, as you may see. So, to cut it short:I needed to calculate my prices on-the-fly and display it in textbox with javascript.Well I did succeed with values of radio button an checbox, but as i know very little javascript, I don't know how to expand the code i got from here:http://javascript.internet.com/forms/update-order-form-no-page-refresh.htmlSo what I would LOVE to know, is how can I make this happen:I have a textbox:<input type="text" name="podstranice" size="19" lass="podstr"nkeyup="this.form.total.value=calculateTotal(this);">and when a user inputs a number in it, javascript multiplies it with some other number, say 10 (its a price*quantity thing) and adds it to the total price along with data from checkboxes and radio buttons.And so, this is my javascript. It is basically identical to one on the link, but you can view it better this way I think.

// Calculate the total for items in the form which are selected.
function calculateTotal(inputItem) {
with (inputItem.form) {

[code]....

View 27 Replies View Related

Order Form Calculation With Checkbox & Textbox

Oct 14, 2005

I have a form which i want to calculate entered values in text boxes. What i want from the below code is ;

1- i may have 100 textboxes so the javascript that i use may be inefficient for larger amounts. Does anyone have more encapsulated solution for multiplying and adding to total amount?

2- when i click check boxes their values must be added to total textbox below.

3- How can i calculate VAT and grand total? with $ sign infront of them ?

its seems easy but couldn't manage to do as i am not a programmer.

View 1 Replies View Related

Only Submit Positive Results In Order Form?

Aug 13, 2010

I would like to be able to make it so that an order form only submits positive results.I have modified this form for my friends website. She has 50 different products that she makes (different sizes and colors). The form submits results for things ordered but also for things not ordered.

PROD_yellow_3.00=
PROD_green_3.00=
PROD_blue_3.00=

[code]....

View 17 Replies View Related

Passing Form Data To Clickbank Order Page?

Aug 9, 2009

I have a "pre-order" opt-in page disguised as a "step 1" in the order process of a clickbank product I'm ready to launch.I'm wanting to pass the user's first name, last name, and email address (built into the optin form) over to the clickbank order page upon submit.Clickbank gives me the data strings you can pass along, but I'm not sure how to properly configure this function or where to place it in my page code.This is the only step I have remaining before I can go live, and it's holding me back.I can provide any code needed for review to assist in getting this wrapped up.

View 2 Replies View Related

Create A Order Form That Auto Calculates My Totals?

Oct 2, 2011

I am trying to create a order form that auto calculates my totals as I enter the quantities. It comes up with Not a Number(NaN).Below are snippets from my code this is obviously in a <form>:

HTML:
<!-- Row 3, Col 3 purchase boxes -->
<td colspan="1" height="120" align="left">
<input style="margin-left: 60px" type="text" name="bed_359" size="3" maxlength="3" onchange="calculateValue(this.form)" /> R359</td></tr>[code].....

View 7 Replies View Related

Update Order Form Without Page Refresh Modification

Feb 4, 2010

[URL]. I looked at this script and I tried playing around with it but could not figure out how to: Instead of having a check box field and then a radio box field, have 2 radio box fields, so the user picks from one group of radio boxes and then another. Then change the math behind it so the values in the first field are multiplied by 100 and then the values in the second field tack on a percentage (ex value in first field is 1.5 so 1.5x100 = 150 and value in second field is .5 so total is 225).

View 1 Replies View Related

Positioned Layers/Radio Buttons On Order Form Won't Work

Dec 1, 2011

I can't get the form validation and the postioned layers/radio buttons working at the same time is either 1 of the other. I have provided the code html/css/javascript code below [URL]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[code]...

View 5 Replies View Related

Order Form Change Text Fields With Select Fields

Jan 24, 2011

I have this order form where the customers can change the quantity by intput in a text field.I would like to have the text field changed with select fields, but doing so in the form, the script is not doing anymore.Can anyone have a look and tell me what to change in the scritp to accept select fields in place of the text fields.

View 5 Replies View Related

Oncheck Adding / Subtracting Not Adding Up?

Mar 4, 2010

I'm having a problem when I uncheck the box it should subtract the amount from the total which it does kind of. It subtracts a number other that one selected. When I put a alert into the function it pops up with the right amount.URL...click on "comps"uncheck the box under the zillow table.it should remove the amount of SqFt under the little table under the map.The only one that I've established is the zillow.[code]

View 1 Replies View Related

Order Of Execution

Jul 20, 2005

It prints 0,1,...,9, but you cannot see the word "hi". It seems that it prints "hi" then executes the listnum function. But the listnum function is placed before "hi". Could you
give me some info on order of execution?

<HEAD>
<SCRIPT language=JavaScript>
function listnum() {
i=0
do {
document.write( i + "<br>")
i++
} while(i<10)
}</SCRIPT>
</HEAD>

<BODY onload=listnum()>
hi
</BODY>

View 2 Replies View Related

JS - Run Order In PHP Page

Jan 7, 2010

I've got a page (internal website) that performs some operations, working it's way down a list and putting a tick beside the operation it's just completed (so the user can see where it's got to so far).

Each operation takes a minute or so, and they include things like: adjusting table contents in an Oracle database, performing some Unix server commands etc...

Because of this, the Oracle and Unix parts are handled server-side by php (very easy), but the javascript parts of the page to change the egg-timer to a tick doesn't wait - it just displays ticks down the entire list immediately.

Is there some way to get javascript to wait until the preceding php has completed?

View 2 Replies View Related

Get The Order Of Elements

Feb 16, 2009

Dear fellow developer, Would you show me how I can get the order of a bunch of <li>s in <ul>?

[Code]...

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved