I want to override the onsubmit attribute of the form on the newthread page as I have added a few custom fields to it that I need to validate. However the onsubmit value will not change. Here's what I am doing -
Code:
var form = document.getElementsByTagName("form")[1];
form.onsubmit = 'override_submit()';
And nothing changes. However if I try to change the action attribute of the form it works no problem.
Code:
form.action= 'xyz';
So any ideas on what I am doing wrong?