Vote count:
0
I am trying to send a form by using a click event to trigger the form submission. For some reason however, this does not seem to work.
Code:
<form id="send_intake">
<div class="input_line">Voornaam: <input type="text" name="firstname" id="send_intake_firstname"></div>
<div class="input_line">Achternaam: <input type="text" name="lastname" id="send_intake_lastname"></div>
<div class="input_line">E-mailadres: <input type="email" name="email" id="send_intake_email"></div>
<input type="submit" class="form_submit" value="Stuur">
</form>
<script>
//Send form
$(document).ready(function(){
$(".function_header").on( "click", "#submit_send_intake", function() {
alert ("click event fired.");
$("#send_intake").submit(function() {
$.post("pages/forms_intake/functions/send_intake_form.php", $("#send_intake").serialize());
});
});
});
</script>
Hope you guys can see what's going wrong here :(
asked 1 min ago
Submit form on click doesn't work
Aucun commentaire:
Enregistrer un commentaire