i have a JS calculator on my site right now that lets users calculate what an order will cost, i'm trying to figure out how to determine a cost by the amount input by an user to determine delivery cost, say the users inputs 1-3, the amount will be 8, 4-7 will be 10, etc.
dealing with variables in forms
Started by pioneer27, Apr 17 2009 03:53 PM
2 replies to this topic
#1
Posted 17 April 2009 - 03:53 PM
|
|
|
#2
Posted 17 April 2009 - 03:56 PM
i know with php i could use a switch or if function, is there something simliar with JS?
#3
Posted 18 April 2009 - 01:51 AM
pioneer27 said:
i know with php i could use a switch or if function, is there something simliar with JS?
Yes, there is...
Small example taken from site
switch(n)
{
case 1:
execute code block 1
break;
case 2:
execute code block 2
break;
default:
code to be executed if n is
different from case 1 and 2
}
JavaScript Switch Statement


Sign In
Create Account


Back to top









