teacherfund / TeacherFund_next

A website to fund teachers discretionary spending because the government sucks at it
https://theteacherfund.com
MIT License
90 stars 87 forks source link

Use form and button elements for donation form #120

Closed meowwwls closed 5 years ago

meowwwls commented 5 years ago

Currently, the donation form was using div elements for the form itself as well as the "donate" button. This is not semantic HTML, and it also removes a lot of built in accessibility and functionality the browser takes care of for us.

I've changed it to use a form element and the onSubmit event (vs the click event it was using which not only gives us semantic markup, but by using a form, anyone navigating with their keyboard can use the enter key to submit it, which is expected behavior (and will trigger the donate function just as clicking the button does).

I have also used a button element for the "donate" button, making things semantic as well as fully keyboard accessible.

vercel[bot] commented 5 years ago

This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://teacherfund-git-fork-meowwwls-fix-donate-form-a11y-donatebtn.teacherfund1.now.sh