E-mail List Archives
Re: Forms that delete something
From: Peter Weil
Date: Jan 10, 2024 7:33AM
- Next message: harald.fiedler@trotz-dem.at: "I need a List auf all sites auf a Website"
- Previous message: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Next message in Thread: None
- Previous message in Thread: tim.harshbarger@deque.com: "Re: Forms that delete something"
- View all messages in this Thread
Thanks for clarifying this, Tim.
I don't think there's any question that using a button, using the technique described below, is the way to go for making a one-off change to a database. Using a form for this seems perfectly fine, but perhaps not always necessary. If you have a page with multiple delete (and perhaps other) buttons on a page, embedding each button within a form could get a little onerous, especially if there is little or no clear advantage to doing so.
Inertia.js, for example, provides a REST API that enables you to make make DELETE, PATCH, etc. requests without using a form. This can be very useful and convenient, as long as you make the buttons accessible.
Peter
> On Jan 10, 2024, at 7:25 AM, <EMAIL REMOVED> wrote:
>
> Yes, that is correct. That is what I meant to write.
>
> A screen reader will not tell a user if a form control is nested inside a form element.
>
> If someone does think it is important the screen reader user know that form controls are part of a form, then there are techniques that can be used to do that. However, just nesting controls inside a form element will not do that.
>
> The crucial aspects of the technique that was originally mentioned are:
>
> * It is possible to tab to the button and activate it with a keyboard.
> * The button conveys its role.
> * The button conveys an accessible name.
>
> It sounds like the technique did all of that. One additional consideration might be if there are multiple delete buttons on the same page. In that case, you might want to include additional information so it is more obvious to a screen reader user what the delete button will delete.
>
> If there is some kind of confirmation message for the delete action, you will also want to ensure there is some way screen reader users are informed of that status.
>
> Again, there are other reasons why someone would use a form element to contain all the controls for a form, but none of those reasons involve it somehow automatically informing screen reader users of that information.
>
> I apologize for the lack of clarity on the last response. I hope this helps.
>
> Thanks!
> Tim
>
- Next message: harald.fiedler@trotz-dem.at: "I need a List auf all sites auf a Website"
- Previous message: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Next message in Thread: None
- Previous message in Thread: tim.harshbarger@deque.com: "Re: Forms that delete something"
- View all messages in this Thread