Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Java Script Array problem


Message #1 by Peter Bennett <peter.bennett@t...> on Tue, 22 May 2001 11:03:15 +0100
Well, I have answered my own question now I have posted it.
The problem was not the array, it is that the ArrayNumber being passed to 
the function is a value in IE, but turns out to be null in Netscape, so I 
was looking for solutions in the wrong place.
Thank you

Peter
 

> I have made a java script array, then I am using a select box on change
> event to display contents of the array in a text area.
> This works fine in Internet Explorer, but in Netscape it 
says "BlockRecords
> has no properties. " (BlockRecords is the name of the main array)
> Can any one help explain what I am doing wrong.
> 
> I have put a sample of the code at the bottom
> 
> thank you
> Peter
> 
> 		<script language="JavaScript">
> 		<!--
> 
> 		//declare the array
> 		var BlockRecords = new Array();
> 		
> 		BlockRecords[0] = new Array();
> 		BlockRecords[0][0] = 36;
> 		BlockRecords[0][1] = test 1';
> 		BlockRecords[0][2] = 'A test
> 		BlockRecords[0][3] = ''	;
> 
> 		BlockRecords[1] = new Array();
> 		BlockRecords[1][0] = 37;
> 		BlockRecords[1][1] = 'test  2';
> 		BlockRecords[1][2] = 'Another test
> 		BlockRecords[1][3] = ''	;
> 		
> 		BlockRecords[2] = new Array();
> 		BlockRecords[2][0] = 38;
> 		BlockRecords[2][1] = 'test 3';
> 		BlockRecords[2][2] = Yet another test
> 		BlockRecords[2][3] = ''	;
> 
> 
> 		//call the appropriate array number for display
> 		function DetailsDisplay( ArrayNumber ) 
> 		{
> 		   document.choices.description.readonly=false;
> 		   document.choices.description.value 
> BlockRecords[ArrayNumber][2];
> 		   document.choices.description.readonly=true;
> 		}
> 		-->
> 		</script>
> 
> 
> 
> 
> 
> 
> Peter Bennett
> mailto:peter.bennett@t...
> 
> TELEMATICA LIMITED
> Newburn Centre, Newburn Crescent
> Swindon, Wilts, SN1 5ES, UK
> Tel: +44 (0)1793 530844
> Fax: +44 (0)1793 530521
> mailto:info@t...
> http://www.telematica.co.uk
> 

  Return to Index