I have added a form to my html page dynamically using javascript. The .submit on the form does not work when I do this. However if I create the exact same form in html, it works as expected.
Here is a fiddle: http://jsfiddle.net/dwha77g4/4/
The following code:
$('.submit-form').submit(function(e){
alert("test");
e.preventDefault();
});
runs on the first button in the fiddle, but not the second dynamically created one.