I'm seeing a strange problem in my jQuery in a Ruby on Rails application:
I'm loading content using ajax.load() into an absolute positioned div (modal). The loaded HTML contains a <form>
-element with both action
and method
parameters as well as a submit-button (input type=submit
). I have another form present in the 'main' document (with another ID etc.)
However, when I click the submit-button to submit the form, nothing happens. I've tried subscribing to various events via. jQuery to debug:
- Subscribing (via
live()
) toform:mouseover
yields a result when hovering the form - both in the modal and on the page itself. - Subscribing to
input[type=submit]:mouseover
yields a result when hovering the submit-button - both in the modal and page itself. - HOWEVER - subscribing to either
input[type=submit]:click
orform:submit
ONLY works on the page itself and not in the loaded form.
The problem is clearly that I'm displaying a form, that the user is unable to submit. How can this be?
Thanks!