Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Built-in validation is pretty much the only reason I use forms.

Capturing input with frameworks is much simpler than pulling the values out of an event object, so I'd be okay with just using input and button elements.

Yet, that doesn't trigger the validation, so I end up wrapping it with a form element and using a submit button.



> Yet, that doesn't trigger the validation, so I end up wrapping it with a form element and using a submit button.

I run the validation manually using `reportValidity()` on `element.querySelector(...)` before passing it on to whatever.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: