These form is dynamically added to the document:
<form action="" method="post">
name:<input type="text" name="name" /> <br/>
<p><input type="submit" /></p>
</form>
and the jquery/js function doesnt work for it.
$(function() {
$('form').on( "submit", function(e) {
e.preventDefault(); // Stop normal submission
alert("submit");
If i add the form direct to the document instead of dynamically then it works. Whats wrong? Any ideas?