Total members 11894 |It is currently Sun Nov 24, 2024 6:02 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi, I have this exercise to do, and it's almost finished but I am stuck on the calculation. I need to calculate the total price. Not sure what I need to do to make the totalprice function work.
This is just a learning material. It only works in IE, and it's not a problem.
I can email the code to someone if needed.

This is the function that should calculate within a form but it doesn't.

function calculate(value)
{
var totalprice = value;
var notickets = value;
var ticketprice = value;
var add = 10

if(notickets < 4)
{
totalprice = (ticketprice * (notickets))

}

else if(notickets >= 4)
{
totalprice = (ticketprice * (notickets)) + add

}

else
{
alert("Before you can calculate your total price you have to make your selection.")
return false
}
}




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Need help with JavaScript function calculate the total pric!
 calculate the total type of stocks     -  
 getting gst, pst total to diplay in my javascript form     -  
 calculates the total cost with javascript     -  
 Vectorized Matlab function calculate Euclidean distance     -  
 calculate sum of many text inputs in javascript     -  
 Popup message using JavaScript without using alert function     -  
 Document Object Write Function in JavaScript     -  
 Get Disk total space     -  
 diskfree and disk total from cdr's     -  
 total ocurrence of substring in sting     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com