Updated form submission with @bradleywright's contribution