Skip to content

Commit

Permalink
Update contact.html
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacTeng committed Apr 4, 2024
1 parent 4e14adf commit e5c8406
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</div>
<div>
<!-- your other form fields go here -->
<button type="submit">Send</button>
<button type="submit" onclick="submitForm()">Send</button>
</div>
</form>

Expand All @@ -70,8 +70,13 @@
document.getElementById("mySidebar").style.display = "none";
}

$(window).load(function() {
$('form').children('input:not(#submit)').val('')
function submitForm() {
// Get the first form with the name
// Hopefully there is only one, but there are more, select the correct index
var frm = document.getElementsByName('contact-form')[0];
frm.submit(); // Submit
frm.reset(); // Reset
return false; // Prevent page refresh
}

</script>

0 comments on commit e5c8406

Please sign in to comment.