R
Rich
I am close than I was before and I thank y'all for your Great Help!!
I wrote the following script with help.
So far it does what I want, it will prompt user for Input, then Display the
User's inputted information in a Table using the document.write. Which is
great.
The only thing I'm not understanding is how to have it display the amount of
Strings and Numbers in a table.
I thought the document.write(isNaN(parseInt (myArray[1]))) would display the
info but it only comes up with a True or False reply. (see script below)
Any help would be GREATLY appreicated.
Rich
<HTML>
<HEAD>
<TITLE>Array Man</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE = JavaScript>
var myArray = [];
myArray[0] = [];
myArray[0][0] = prompt ("Enter First Name:", " ");
myArray[0][1] = prompt ("Enter Last Name:", " ");
myArray[0][2] = prompt ("Enter City you currently live in:", " ");
myArray[1] = [];
myArray[1][0] = prompt ("Enter Zip Code:", " ");
myArray[1][1] = prompt ("Enter your Age:", " ");
myArray[1][2] = prompt ("Enter Number of Years in College:", " ");
var row;
var column;
document.write("<table width=\"25%\" border=\"1\" align=\"center\"
cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"ddffff\">");
document.write("<tr>");
for (column in myArray[0])
{
document.write("<td>" + myArray[0][column] + "</td>");
}
document.write("</tr><tr>");
for (column in myArray[1])
{
document.write("<td>" + myArray[1][column] + "</td>");
}
document.write("</tr>");
document.write("</table>");
document.write(isNaN(parseInt (myArray[1])))
</script>
</body>
</html>
I wrote the following script with help.
So far it does what I want, it will prompt user for Input, then Display the
User's inputted information in a Table using the document.write. Which is
great.
The only thing I'm not understanding is how to have it display the amount of
Strings and Numbers in a table.
I thought the document.write(isNaN(parseInt (myArray[1]))) would display the
info but it only comes up with a True or False reply. (see script below)
Any help would be GREATLY appreicated.
Rich
<HTML>
<HEAD>
<TITLE>Array Man</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE = JavaScript>
var myArray = [];
myArray[0] = [];
myArray[0][0] = prompt ("Enter First Name:", " ");
myArray[0][1] = prompt ("Enter Last Name:", " ");
myArray[0][2] = prompt ("Enter City you currently live in:", " ");
myArray[1] = [];
myArray[1][0] = prompt ("Enter Zip Code:", " ");
myArray[1][1] = prompt ("Enter your Age:", " ");
myArray[1][2] = prompt ("Enter Number of Years in College:", " ");
var row;
var column;
document.write("<table width=\"25%\" border=\"1\" align=\"center\"
cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"ddffff\">");
document.write("<tr>");
for (column in myArray[0])
{
document.write("<td>" + myArray[0][column] + "</td>");
}
document.write("</tr><tr>");
for (column in myArray[1])
{
document.write("<td>" + myArray[1][column] + "</td>");
}
document.write("</tr>");
document.write("</table>");
document.write(isNaN(parseInt (myArray[1])))
</script>
</body>
</html>