javascript - want use a submit handler -
i have html file. want utilize submit handler must phone call custom.js in custom.js contact.php called
html
<div id="submit"> <button type="submit" class="btn btn-lg btn-success">send</button></div> jquery
$('#submit').submit(function(e) { $.ajax({ type: 'post', url: 'contact.php', data: $('#participants-summary').serialize(), success: function(data) { alert('ajaxdone'); } }); e.preventdefault(); });
you want jquery submit handler attached form. so
<div id="submit"> needs become
<form id="submit"> for
$("#submit").submit( to work
javascript php jquery html
No comments:
Post a Comment