I can bind a jquery event to this element like:
<script type="text/javascript">
$('#new_key').ready(function() {
alert('Handler for .submit() called.');
return false;
});
It works as expected
but if i do:
<script type="text/javascript">
$('#new_key').submit(function() {
alert('Handler for .submit() called.');
return false;
});
it dont work. does anybody knows why? what am i missing?
You need to do:
The form may not be ready to be bound to when you’re calling, so you need to wrap it to execute and rig up the handler when the document is ready.