View Full Version : Array How to Question

03-11-2004, 07:36 PM
:confused: I need a piece of info to help me get started on my next project.... If I prompt the visitor to enter a list, such as a list of friends, how do I save those names to an array? All I can think of is something like, "var friends = prompt(please enter the names of all your friends. Enter 'End' when you are finished." When the visitor finishes entering then names by typing in "End", I want to display the names back, one by one, and ask them to enter a gift suggestion for each friend Then I want to save those gifts in a separate parallel array. If you can get me started, I'll see how far I can go before I have to ask for additional help!! Thanks!!:rolleyes:

Mr J
03-11-2004, 10:09 PM
This should get you started

<TITLE>Document Title</TITLE>
names=new Array()
index= -1

function getme(){

var friends = prompt("please enter the names of all your friends. Enter 'End' when you are finished.","" )





<BODY onload="getme()">
<div id="mynames"></div>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum