I have a really simple javascript function to return the index of a selected field, it looks like this:
function validateForm() {
alert(document.getElementByID('textfieldAmount').selectedIndex);
return false;
}
This is called from an input button onClick like this:
onclick="return validateForm();"
but the Javascript is never called and the page is submitted anyway.
If i change the alert to alert("wibble"); the alert works fine and the page is not submitted.
The element i am querying looks like this:
<select name="textfieldAmount" id="textfieldAmount" class="form">
Any ideas why its not working before i kill myself?