Adding client side validation to surefoot's engineer contact form.
The attached script is used to add further validation to the form. The validation keeps responses quick by working in the browser before sending any data to the servers.
The code listens for the user to hit submit on the form. Once done, the script will check the message and name fields to see if there is any text written. If not, the code will add a red error message directly below the erroneous field. Otherwise, the form submits successfully.
This function can be added by copying and pasting the entire code snippet into the html document, one line directly above the tag.