This is the relevant code in the js file:
function validateForm()
{
attachEventListener(document.getElementById('addform'), "submit", validateadd, false);
function validateadd()
{
return checking('addfirst','addlast','addmail','addnumber');
}
attachEventListener(document.getElementById('editform'), "submit", validateedit, false);
function validateedit()
{
alert("checking");
return checking('editfirst','editlast','editmail','editnumber');
}
attachEventListener(document.getElementById('addeditform'), "submit", validateaddedit, false);
function validateaddedit()
{
return checking('addeditfirst','addeditlast','addeditmail','addeditnumber');
}
};

addform is from index.php, editform and addeditform are from edit.php. The problem is that it ignoring my 2 last attachEventListeners. I put the alert("checking");
to see if its going into the evenListener and its not. Im connecting to the js file from both index.php and edit.php but its going only into the first eventlistener.
When i click on the submit buttons of editform and addeditform its not doing the validation. What could be the problam?