javascript code:
// JavaScript Document
function getInfo()
{
var username,office,phone,food,amount,cost;
username = document.getElementById("username").value;
office = document.getElementById("office").value;
phone = document.getElementById("phone").value;
food = document.getElementById("food").value;
amount = document.getElementById("amount").value;
switch(food){
case "Sizzling Fry Jacks":
cost = 100;break;
case "Earthy Johnny Cake":
cost = 70;break;
case "Cut-o-Brute":
cost = 50;break;
case "Berlize Traditional Beer":
cost = 30;break;
}
cost *= amount;
alert("Username: "+username+"<br />"+"Office: "+office+"<br />"+"Phone: "+phone+"<br />"+"Food: "+food+"<br />"+"Amount: "+amount+"<br />"+"Total cost: "+cost+"<br /"+"Your food will arrive in 10 minutes!");
}
html code:
<a href="../index.html"><input type='button' value="SUBMIT" name="submit" id="submit" class="apply" onClick="getInfo()" /></a>
why browser doesn't give message of information? i cannot find mistake of my js script...
many thx!
p.s.:don't mind the name of these foods...