Updated to include ajax when clicking the submit button.