So I was playing around with phpBB3 RC5, the latest version of the popular phpBB forum software, when I ran into this error. It’s not a PHP error, actually, but a JavaScript one. I’m working on heavily modifying a phpBB install, and in this case I wanted it to submit a new topic automatically.
The form’s name is postform, so I could just do:
document.postform.submit();
right? No go. I got the above error in Firebug, which claims postform has no properties. After lots of Googling, I found a fix:
document.getElementById(’postform’).submit();
But this still wasn’t working right, because phpBB wasn’t responding properly. Instead of posting the message, like it would if I had clicked Submit manually, it was just showing me the post form again. The key was the click. So instead of submitting, let’s click!
document.getElementById(’postform’).click();
It works!