Submit button's click() method suddenly undefined

Permalink
I've been developing a site for my uncle, creating a couple of custom blocks for it, and it has all worked fine until now.

I was changing the permissions on that specific page, and when I saved the updated permissions, my block disappeared. I changed the permissions back to see if that would solve it (thus I would have a debugging starting point), but it didn't. So I tried adding the block, and when I clicked the 'Add' button, nothing happened.

Looking at the call that the add button makes, I used the javascript console in Chrome to try and figure out what was going wrong.

$('#ccm-form-submit-button').get(0)
<input type="submit" name="ccm-add-block-submit" value="submit" style="display:​ none" id="ccm-form-submit-button">​
$('#ccm-form-submit-button').get(0).click()
undefined


I have tried to comment out all the javascript I'm using to see if maybe that's what's causing this, but it doesn't seem to be the case. I'll be happy to share code or whatever is necessary, but can someone think of something that could cause this to happen?

 
AngelOD replied on at Permalink Best Answer Reply
Note to self: Do not code while tired, and definitely do not try to debug while tired, you WILL miss those really simple mistakes.

Long story short; I was closing a DIV I was no longer opening in the first place, which messed up things.