text written (choices)inside the form for user to random choice?
hi can anybody please check this im making a random curry choice for people to choose and need help
i got this code from some where can anybody help me please i need to have the list built inside it like options to choose can anybody tell me how can i do that im not good at all with coding and only few weeks a go start learning
im typing the code below thanks guys much apreciated
<html>
<head>
<title> Random Choice </title>
<SCRIPT>
// When we move out of the text window,
// or when we click the submit button,
// choose a random line from the input window
// and copy it to the output
function PickOne()
{
var f = document.parm;
// select the input
var allInput = f.InArea.value;
// allInput should be a string
// create an array of strings, splitting at newlines
var a = allInput.split("\n");
var nStrings = a.length;
// while the last line is blank, ignore it
while (a[nStrings-1] == "") nStrings = nStrings - 1;
// get a random index (but as a float)
var n1 = Math.random() * nStrings;
// get an integer value
var nSelect = Math.floor(n1);
// and display the selected line
f.SelectedOne.value = a[nSelect];
}
</SCRIPT>
</head>
<body bgcolor="#D8E9E8">
<h1> Random Choice </h1>
<p>
<form NAME=parm>
<p>
Enter items from which to choose (one per line)
<p>
<table>
<!- The input text area -->
<tr><td><textarea NAME=InArea rows=5 cols=40></textarea> </td></tr>
<tr><td><hr> </td> <td><br></td></tr>
<!- The output selected item -->
<tr><td><INPUT TYPE=button value="Choose" onClick="PickOne()"></td></tr>
<tr><td><textarea NAME=SelectedOne rows=1 cols=40> </textarea></td></tr>
<tr><td><hr> </td> <td><br></td></tr>
<!- for completeness -- to empty both input and output -->
<tr><td><INPUT TYPE=reset>
</table>
</FORM>
</body>
</html>
basically i need to be showed how to put a list inside ready so user only gotta press choice button
thanks