This is the code of an HTML form as shown by Firebug:
<form action="http://localhost/home/newuser" method="post">
<input type="hidden" value="48" name="user_id">
<input type="text" name="username">
<input type="submit" value="Next">
</form>
And here's some jQuery code bound to it:
$('.popup .newuser form').live('submit', function()
{
$(this).ajaxSubmit(function(data)
{
// handle response
});
return false;
});
However, when I click on the "Next" button, what happens is that the text field shows a combobox of previously entered values (a Firefox feature). There is no HTML request showing up on Firebug's Network tab, and breakpoints in the jQuery listener are not hit.
It feels like I'm missing something really obvious...
Update: I've realized that something even stranger is going on: I cannot enter anything in the text field either via keyboard. I can only select the previous values from the Firefox combobox. And after doing that, I can't even select the text in the box.
liveisn't successfully wiring up to the event, or maybe the selector has an issue? I know it sounds obvious, but are thepopupandnewuserclassed tags surrounding the form? Is it possible thatpopupandnewuserare sibling classes (i.e.<div class="popup newuser">)? If that's the case, then the selector should be$('.popup.newuser ...')without the space.