Hi Guys,

I am really stumped.

I wrote a program that is supposed to submit information about a baseball team players and their positions.

The program stores the data as an array using oop and then displays only the name and surname in a list where you can edit the full profile from.

but when i click the button nothing happens. I have even tested it with a run a onclick=window.alert('test') and upon click nothing appears. Please help. Im also wondering whether i need to get the information from the textboxes as elements or by using their ids.

Code Below






Code:
<!DOCTYPE HTML>

<html>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="general.css" rel="stylesheet" type="text/css">
<script type="text/javascript">


/* <![CDATA[*/


function team(){


this.tName="";
this.cName="";
this.cContact="";
this.cEmail="";
this.mName="";
this.mSurname="";
this.mContact="";
this.pPlayed="";
this.getMember= getMemberInfo;
this.updateMember = updateSelectedMember;

fuction test(){
if (document.forms[0].teamName.value=="AS")
window.alert("nothing entered");
}
}
function getMemberInfo() {

document.forms[0].teamName.value=this.tName;
document.forms[0].coachName.value=this.cName;
document.forms[0].coachContact.value=this.cContact;
document.forms[0].coachEmail.value=this.cEmail;
document.forms[0].name.value=this.mName;
document.forms[0].surname.value=this.mSurname;
document.forms[0].telNum.value=this.mContact;
document.forms[0].positionPlayed.value=this.pPlayed;


}


function updateSelectedMember(curIndex) {

this.tName=document.forms[0].teamName.value;
this.cName=document.forms[0].coachName.value;
this.cContact=document.forms[0].coachContact.value;
this.cEmail=document.forms[0].coachEmail.value;
this.mName=document.forms[0].name.value;
this.mSurname=document.forms[0].surname.value;
this.mContact=document.forms[0].telNum.value;
this.pPlayed=document.forms[0].positionPlayed.value;
document.forms[0].viewMembers.options[curIndex].value = this.mSurname + ", " + this.mName;
document.forms[0].viewMembers.options[curIndex].value = this.mSurname + ", " + this.mName;
window.alert("Member information Updated");
}

var memberList=new Object();




fuction addMember(){
var newMember=0;
for(member in memberList)
{
++newMember;
}
if(document.forms[0].name.value==""||document.forms[0].surname.value=="")
window.alert("You cannot leave the name and/or surname field empty);
else{
memberList["member"+newMember]=new Contact();
memberList["member"+newMember].tName=document.forms[0].teamName.value;
memberList["member"+newMember].cName=document.forms[0].coachName.value;
memberList["member"+newMember].cContact=document.forms[0].coachContact.value;
memberList["member"+newMember].cEmail=document.forms[0].coachEmail.value;
memberList["member"+newMember].mName=document.forms[0].name.value;
memberList["member"+newMember].mSurname=document.forms[0].surname.value;
memberList["member"+newMember].mContact=document.forms[0].telNum.value;
memberList["member"+newMember].pPlayed=document.forms[0].positionPlayed.value;

var createMember= new Option();
createMember.value=memberList["member"+newMember].mSurname+","+memberList["member"+newMember].mName;
createMember.text=memberList["member"+newMember].mSurname+","+memberList["member"+newMember].mName;
document.forms[0].viewMembers.options[newMember] = createMember;

}
}



function deleteMember(){
var memberSelected=false;
var selectedMember=0;
for (var i = 0; i < document.forms[0].viewMembers.options.length; ++i) {
if(document.forms[0].viewMembers.options[i].selected==true){
memberSelected=true;
selectContact=i;
break;
}
}
document.forms[0].viewMembers.options[i]=null;
if(contactSelected==true)
for(prop in contactList){
delete contactList[prop]
}


for (var i=0; i<document.forms[0].contacts.viewMembers.length; ++i){
memberList["member"+i]=new Contact();
memberList["member"+i].tName=document.forms[0].teamName.value;
memberList["member"+i].cName=document.forms[0].coachName.value;
memberList["member"+i].cContact=document.forms[0].coachContact.value;
memberList["member"+i].cEmail=document.forms[0].coachEmail.value;
memberList["member"+i].mName=document.forms[0].name.value;
memberList["member"+i].mSurname=document.forms[0].surname.value;
memberList["member"+i].mContact=document.forms[0].telNum.value;
memberList["member"+i].pPlayed=document.forms[0].positionPlayed.value;
}

}
else
window.alert("you must select a member in the list)





/* ]]> */
















































</script>








	
<TITLE>IN THE GAME TEAM ROSTER</TITLE>
<p class="centeredImage"><img src="http://i1309.photobucket.com/albums/s624/djcurzed/4249748-750273-baseball-in-fire_zpsa79a4a93.jpg"></p>
</head>



<body>
<div>Please select coach and team name</div>
<form action="FormProcessor.html" method="gest" enctype="application/x-www-form-urlencoded">
<table>

<tr>
	<td>
		<c>COACH SECTION</c>
	</td>
</tr>
   

</table>
	
<table>
   
<tr>		
      <td>	
		<h>TEAM NAME</h><br>	
		<input type="text" name="teamName" onblur="test();">
      </td>

      <td>
		
		
		<h>COACH NAME</h><br>
		<input type="text" name="coachName">		



      </td>

   </tr>

</table><br>
<table>
   
<tr>		
      <td>	
		<h>CONTACT NUMBER</h><br>	
		<input type="text" name="coachContact">	
      </td>

      <td>
		
		
		<h>EMAIL ADDRESS</h><br>
		<input type="text" name="coachEmail">		



      </td>

   </tr>

</table>
<table>
		<tr>
		<td>	
		<c>MEMBER SECTION</c>
		</td>
		</tr>
		
</table>	
<table>
   <tr>

		
      <td>	
		<h>NAME</h><br>
		<input type="text" name="name">			
      </td>

     <td>
		
		
		<h>SURNAME</h><br>
		<input type="text" name="surname">			



      </td>

   </tr>


</table>
<table>
   <tr>

		
      <td>	
		<h>TELEPHONE NUMBER</h><br>
		<input type="text" name="telNum">		
      </td>

      <td>
		
		
		<h>POSITION PLAYED</h><br>
		<input type="text" name="positionPlayed">		


      </td>

	

   </tr>
	<tr>

			<td>	
		<h>PERMISSION GIVEN</h>
		<input type="checkbox" name="permission" checked="checked">		
      </td>

      <td>
		
		
		<input type="button" value="Add Member" name="addButton" onclick="addMember()">		


      </td>






	</tr>

</table>
<table>
		<tr>
		<td>	
		<c>MEMBER SECTION</c>
		</td>
		</tr>
		
</table>
<table>
   <tr>
	 <td>
		
		
		<SELECT name="viewMembers" size="5">
		<option value="viewMembers">Members</option>	
		</select>	


      </td> 
	 
		
	 <td>
		
		
		<input type="button" value="Edit Member" name="editButton" onclick="window.alert('you clicked a push');"><br>
		<input type="button" value="Delete Member" name="deleteButton" onclick="deleteMember()"><br>		
		<input type="button" value="Submit" name="submitButton">

      
  </td> 
	 
	
		
      
   </tr>

</table>

</form>
</body>
</html>