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

Posts: 10
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
 
When You Register, These Ads Go Away!
Old 04-04-2008, 02:09 PM Re: Javascript - Count
tripy's Avatar
Fetchez la vache!

Posts: 2,055
Name: Thierry
Location: In the void
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.
__________________
Listen to the ducky: "This is awesome!!!"


Last edited by tripy : 04-04-2008 at 02:11 PM.
tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Javascript - Count
 

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

vB 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.11034 seconds with 12 queries