Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 8th, 2007, 08:37 AM
Registered User
Join Date: Aug 2006
Location: , , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript Array Problem


Sorry if this is a really simple task buts its been driving me nuts over the past 2 weeks all i seem to do is go around in circles.

Basically all i want the following code to do is to link the booksArray to the dayOfWeek array so that when the window prompt appears it say "enter books borrowed for [DAY]" and when its displayed using the document.write statement at the bottow it should appear as "books borrowed on [DAY] was [VALUE]"

var booksArray = new Array (5);
var dayOfWeek = ('Mon','Tues','Wed','Thurs','Fri');

document.write('Array program to show............');

for (var dayOfWeek = 0; dayOfWeek < booksArray.length; dayOfWeek = dayOfWeek + 1)
booksArray[dayOfWeek] = window.prompt(Enter number of books for ' + dayOfWeek, '')
document.write('<BR>' + '<BR>');

for (var dayOfWeek = 0; dayOfWeek < booksArray.length; dayOfWeek = dayOfWeek + 1)
document.write('Books borrowed on ' + dayOfWeek[booksArray] + ' was ' + booksArray[dayOfWeek] + '<BR>')

many thanks for you time and apologies if this is really simple but as mentioned above its driving me nuts!!!


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dotnet array object in javascript ramesh.b ASP.NET 1.0 and 1.1 Basics 0 November 26th, 2007 07:27 AM
Field Array Validation in Javascript Asad Khan Apache Tomcat 1 September 4th, 2007 06:14 AM
Reference ASP Array in Javascript gaetano Classic ASP Basics 1 February 21st, 2005 10:09 AM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM

All times are GMT -4. The time now is 01:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.