Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-08-2008, 03:56 PM   PM User | #1
Gez
New Coder

 
Join Date: May 2008
Posts: 32
Thanks: 4
Thanked 0 Times in 0 Posts
Gez is an unknown quantity at this point
data from users using only prompt

I have a array know as 'catalogue' , this is basically a catalogue of books containing some infomation about them (ISBN, price etc.). My task is to allow as user(who has seen the catalogue elsewhere) to enter the ISBN & Quantity using only the prompt feature of js. Now the user may want one book or many, all the data will be stored in a new array called 'order' in the format ['ISBN:quantity','.....]; now as im very new to js i really have no idea how to do this so all help will be greatly appreciated, thanks
Gez
Gez is offline   Reply With Quote
Old 08-08-2008, 04:08 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
For and intro about prompt() in javascript, see http://www.w3schools.com/HTMLDOM/met_win_prompt.asp
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 08-08-2008, 04:18 PM   PM User | #3
Gez
New Coder

 
Join Date: May 2008
Posts: 32
Thanks: 4
Thanked 0 Times in 0 Posts
Gez is an unknown quantity at this point
I know how to do prompts, i just don't know how to include it in a loop so that i can get for example several variables out of it depending on how many books the user wants.
Gez
Gez is offline   Reply With Quote
Old 08-08-2008, 05:56 PM   PM User | #4
ninnypants
Regular Coder

 
ninnypants's Avatar
 
Join Date: Apr 2008
Location: Utah
Posts: 504
Thanks: 10
Thanked 47 Times in 47 Posts
ninnypants is an unknown quantity at this point
Here is a vary basic loop that would do something at least similar to what you need
Code:
books = [books user wants/ your books];
question = [ prompt questions ];
for(i=0; i<books.length; i++){
     prompt(question[i]);// prompts the needed question or phrase or book info depending
}
ninnypants is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 08:08 AM.


Advertisement
Log in to turn off these ads.