Create the main JS file which can send user data and trigger mail. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. To submit a form via AJAX, your script will need to handle four tasks: Capture the form submit button so that the default action does not take place. How to send a PUT/DELETE request in jQuery ? How to set the default value for an HTML