Forum : Multi dimensional array reversal
Brief description  about Online courses   join in Online courses
View Rajagopalan  Nambiar 's Profile

Multi dimensional array reversal

I have created a 3x3 multi-dimensional array and when i try to reverse it, it reverses in groups of 3 (actually its not reversing the values. The code is given below:
=====================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Javascript array assignment</title>
<script language="javascript" type="text/javascript">

Q5= "Question 5: Create a multidimensional array."
function multiarray(){
var faq = new Array(3)

for (i=0; i <3; i )
faq[i]=new Array(3)

faq[0][1] = document.frmOne.itemone.value
faq[0][2] = document.frmOne.itemtwo.value
faq[0][3] = document.frmOne.itemthree.value
faq[1][1] = document.frmOne.itemfour.value
faq[1][2] = document.frmOne.itemfive.value
faq[1][3] = document.frmOne.itemsix.value
faq[2][1] = document.frmOne.itemseven.value
faq[2][2] = document.frmOne.itemeight.value
faq[2][3] = document.frmOne.itemnine.value
alert(faq)
x=faq.reverse()
alert(x)}
//function sort() {
//Y = X.sort();
//document.frmThree.txtFinals.value = Y;
//}
</SCRIPT>

</head>
<body>
"Q5: CREATE DISPLAY
Asked by Rajagopalan Nambiar | Jul 19, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Rajagopalan Nambiar,

I am not getting your problem.. In whole program, nowhere you are calling JS function.. Mail me the full code and tell what u want to do exactly, i mean what result you are expecting...

Regards,
Teacher
Jul 20, 2010