Hi people,

Im having an issue with my array, it instantly shows undefined inputs.
i googled this issue but all i could find is if you were entering your data into a document.write but im using Get.ElementById

i will paste the code below, sorry in advance for it being messy iv been bashing it togethouor.
can someone show me how to get rid of this issue ?

Kind Regards


Code JavaScript:
  <title>Football Teams</title>
  var array = new Array();
  var number =1;
  function insert(val){
  function show() {
  	var string="<b>Teams</b><br>";
 	 for(i = 0; i <10 ; i++) {
  		string =string+array[i]+"<br>";
  if(array.length > 0)
 document.getElementById('myDiv').innerHTML = string;
  function increase()
  number += 1;
  <h2>Team Names</h2>
  <form name="form1">
  <table width="407">
  <td width="154" align="right"><b>Name</b>
  <td width="9"><b>&nbsp;:</b>
  <td width="224">
  <input type="text" name="name"/>
  <td width="154" align="right">
  <td width="9">
  <td width="224">
  <td width="154" align="right">
  <td width="9">
  <td width="224">
  <input type="button" Value="Add Team name to Array" 
  <div id="myDiv"></div>