Making a fully function form with javascript

Making a fully function form with javascript
0

#1

I’m working on my portfolio and want to include a full functional contact form. I know I can use javascript for form validation but how can I set this form up without having to use PHP on the backend?

In addition to the front end what else needs to be done to get a form fully set up and submitting the info to an email address?

Would Node.js be a good approach?


#2

If you don’t know Node yet it would be a bit ahead of things to get into it now. But yes, you can do a form with nothing more than HTML–even the validation can be in the html.


https://www.w3schools.com/html/html_forms.asp
EDIT: actually, I see your point; it still doesn’t make receiving the input via email so easy. https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data and https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_forms_through_JavaScript . I bet there’s some pre-developed widget that would make it easier, though…


#4

You can do this: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail
… but http://form.guide/email-form/email-form-mailto.html (to be clear, this will launch an email client but not actually send the email).
Here’s a walkthrough of the PHP steps: http://htmldog.com/techniques/formtoemail/ …but again, not something you could do from CodePen. For what it’s worth, I had the same desire when I made my portfolio, and ultimately caved and just linked my email address.