Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 04-04-2008, 02:46 PM Javascript - Count
Novice Talker

Posts: 10
Trades: 0
Hi

I need some help with a javascript funcation. I have a 4 question that im asking a user im using window.prompt. I would like to ask these questions 12 times. I have added (count = 0 at the begining of the script and would like it to increase by one each time the 4 questions been asked, and which loop would i use

Cheers

Ron007
ron007 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-04-2008, 03:09 PM Re: Javascript - Count
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Code:
var cntDone=0;
var answer1=null;
var answer2=null;
var answer3=null;
var answer4=null;
while(cntDone<4){
  answer1=window.prompt("what?");
  answer2=window.prompt("what?");
  answer3=window.prompt("what?");
  answer4=window.prompt("what?");
  cntDone++;
}
You could use an array for the answers, but if you are not familiar with javascript programming, I recommend you to start easy.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 04-04-2008 at 03:11 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Javascript - Count
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09882 seconds with 12 queries