Security is definitely an issue when doing the validation on the client-side. We should always validate the data on the backend server again. Thanks for reminding that.
For accessible, I should add aria-label for the button.
<buttontype="submit"aria-label="submit"></button>
Form submit event will be blocked if any of the input is invalid.
<formonsubmit={xxx}>...</form>
But If we use the button click event to submit the result, then we will need to add extra CSS to prevent the click event.
Just keep in mind that anyone (with a little tech background) can edit html/css/js with browser inspector, or even forge requests from scratch ^^'
For the accessibility, I was thinking about add/removing the disabled attribute on the button, to inform that the user can't send the form if it isn't properly filled (especially for color blind people or those who uses readers) ; and prefer the submit event on form, instead of banking on the button :p
Anyway, still a great post !
Cheers
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks a lot for the feedback.
But If we use the button click event to submit the result, then we will need to add extra CSS to prevent the click event.
Just keep in mind that anyone (with a little tech background) can edit html/css/js with browser inspector, or even forge requests from scratch ^^'
For the accessibility, I was thinking about add/removing the disabled attribute on the button, to inform that the user can't send the form if it isn't properly filled (especially for color blind people or those who uses readers) ; and prefer the submit event on form, instead of banking on the button :p
Anyway, still a great post !
Cheers