Can I change the jquery to plain js and how do I send the errors back to the form
Hello,
I have this challenge
Task:
Develop a shortcode that will output a simple contact form. This contact form, when submitted, will use wp_mail to send the email.
Requirements:
Shortcode needs to have fields: Subject (input), Email (input), Message (textarea),
Sanitize all fields before being used for sending it,
Use wp_mail to send the email
Style it and enqueue style only on pages where the shortcode is
Display errors on top of the form
I found a tutorial that does almost that but it works with jquery.
Now my question are : 1) is there a way I can convert the jquery to plain js. 2) How do I make it work that if there is a validation error I can show it also above the form.