6 Replies
Hidden form (with display: none)
Assistive technologies (like screen readers) may not detect the form at all, depending on how the browser and screen reader interpret display: none.
Lack of user feedback
If there's no visible form or confirmation UI, users (especially keyboard or screen reader users) may not know what's going to happen when they press the "Delete Post" button.
“Delete Post” is a terminating action. so there should be some aria-label, confirmation prompt, or dialog to make this interaction clearer.
I hope you get
You can just use a visible form:
but if you want to keep the button outside the form just hide it with css.
Yeah you're right, but I wrote it just an example, what I meant was, is a form, where all related field are outside of it, accessible?
something like:
I believe it's valid in HTML5 and will work as supposed, but it can come in with some accessibility and semantic drawbacks. so, generally It's not ideal for accessibility.
it will come with issues that will affect screen readers and few other factors which i'm not really sure of.
Thanks @corizon.
you're welcome bro
Put button in form
As an input type button