Javascript Function wont submit form..
- by Josh K
Here is my function:
function processCheck() {
var numberClicked = 0;
var frm = document.getElementById('form');
for (var i=0; i<form.elements.length; i++) {
if (frm.elements[i].checked)
numberClicked++;
}
if(numberClicked != 8)
alert('Must choose 8 Teams');
else
frm.submit();
}
My forms name is 'form', here is my input:
echo "<input type='button' name='submit' value='Update' onclick='processCheck()' />";
When i click the button and there is anything but 8 boxes selected it displays the alert, if there is 8 boxes it does nothing (<-- The problem). I have the form action set to another page.