javascript onClick not firing

Cookie232

New Member
I have a really simple javascript function to return the index of a selected field, it looks like this:\[code\]function validateForm(){ alert(document.getElementByID('textfieldAmount').selectedIndex); return false; }\[/code\]This is called from an input button onClick like this:\[code\]onclick="return validateForm();" \[/code\]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:\[code\]<select name="textfieldAmount" id="textfieldAmount" class="form">\[/code\]Any ideas why its not working before i kill myself?
 
Back
Top