Javascript

This is a discussion on "Javascript" within the JavaScript Forum section. This forum, and the thread "Javascript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 16th, 2003, 06:27
New Member
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript

To all of you wise javascripters,
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>

  #2 (permalink)  
Old Oct 16th, 2003, 08:19
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
See my reply at: http://www.webforumz.com/topic.asp?TOPIC_ID=353

u2o
Closed Thread

Tags
javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript yvettesio JavaScript Forum 8 Mar 14th, 2007 23:18
JavaScript cbrams9 JavaScript Forum 1 Sep 20th, 2006 17:35
using xml in javascript shailu JavaScript Forum 0 Jul 25th, 2006 07:36
Can someone help me with this javascript Galaxyblue JavaScript Forum 2 Mar 11th, 2004 12:18
what does \\ mean in javascript jenjen1018 JavaScript Forum 5 Jan 6th, 2004 17:05


All times are GMT. The time now is 04:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43