To all of you wise computer programmers,
I entered my text here below, and I am wondering how I would be able to add an "if" statement to the program that after the "confirm,"the program will display an alety box with an error message, if the user presses "cancel" instead of OK? Thank you very much for your time and help.
<
HTML>
<Head>
<TITLE>JAVAScript</TITLE>
</Head>
<BODY>
<Script Language:"javascript">
var x= window.prompt("How many Home PC's would you like?>>");
var y= window.prompt("How many Gamer PC's would you like?>>");
var z= window.prompt("How many business PC's would you like?");
var pu= window.prompt("How many Power user PC's would you like?");
window.confirm("Home PC's = "+x+" Gamer PC's ="+y);
window.confirm("Business PC's ="+z+" Power User PC's ="+pu);
var M = ((x*1)+(y*1)+(z*1)+(pu*1))
var R = ((x*1)+(y*2)+(z*4)+(pu*4))
var C = ((x*1)+(y*0)+(z*1)+(pu*1))
var D = ((x*0)+(y*1)+(z*0)+(pu*1))
document.write("For "+x+" Home PCs, "+y+" Gamer PCs, "+z+" Business PCs, and "+pu+" Power User PCs, you will need to order:");
document.write("
"+M+" Motherboard(s) </p>");
document.write("
"+R+" RAM Module(s) </p>");
document.write("
"+C+" CD/RW drive(s) </p>");
document.write("
"+D+" DVD drive(s) </p>");
document.write("<h1>CALCulator</h1>");1
</script>
</body>
</
html>