E-mail List Archives
Re: Forms that delete something
From: Jeremy Echols
Date: Jan 8, 2024 3:47PM
- Next message: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Previous message: Dean.Vasile@outlook.com: "Re: Forms that delete something"
- Next message in Thread: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Previous message in Thread: Dean.Vasile@outlook.com: "Re: Forms that delete something"
- View all messages in this Thread
Agreed - the HTML "form" may feel like it's incorrect because the name "form" sort of suggests to our collective conscious something with lots of blank spaces that needs information. But it is indeed the right element to use for deletion.
Think of it as a pre-filled paper form where all you have to do is submit it to the right person / organization in order to, say, start a free trial of Sirius XM or something. All the necessary data was pre-printed onto that form because they want it to be easy, so all you have to do is submit it. Same concept with the button-only form: it's been "pre-filled" with the hidden values (such as the request to delete a record). And the action itself, which holds the destination URL, is also just pre-filled data telling the form what it's for and likely the database ID of the record to delete.
-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of <EMAIL REMOVED>
Sent: Monday, January 8, 2024 12:54
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] Forms that delete something
Using a form with just a button for deletion is a common and accessible approach. Screen reader users are accustomed to interacting with forms for various actions, including deletion. It helps maintain consistency and aligns with web accessibility standards.
Dean Vasile
617-799-1162
> On Jan 8, 2024, at 3:49â¯PM, Laurence Hughes < <EMAIL REMOVED> > wrote:
>
> Hi,
>
> My companyâs web app is written in Ruby on Rails. As a developer, when
> you want to let the user delete something (from the database), a
> common approach is to use the Rails `button_toâ method. As a developer
> you pass into this method some text for a button and a URL for a
> server resource which will handle deleting the data. In terms of
> rendered HTML, the method generates a form set to use the POST method
> and to submit to the URL you provided. The form includes a button of
> type âsubmitâ and no other form elements except a hidden input which
> tells Rails to perform an HTTP DELETE rather than a POST.
>
> As a sighted user, all I see is a button.
>
> I see some benefits to this pattern. Developers have, for a long time,
> misused links (with the help of JavaScript) to enable deletion, and
> this isnât good. As we know, links are for a different purpose, and
> using a link for an unintended purpose breaks user expectations.
>
> But while Iâm sure that a link is the wrong tool for the job of
> deleting something from a database, Iâm also not 100% sure whether a
> form, that only includes a single element (a button), is the right interface to present.
> The user isnât really âinputtingâ anything, either to add, edit or
> search, so is a form OK here?
>
> Would this feel weird to a screen reader user? A form with no other
> elements except a button that says âDelete xyzâ? Or am I being silly
> and this is perfectly normal, and is the expected/conventional way to
> provide a âDelete xyzâ interface accessibly?
>
> Thanks in advance for any advice!
> Laurence
- Next message: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Previous message: Dean.Vasile@outlook.com: "Re: Forms that delete something"
- Next message in Thread: tim.harshbarger@deque.com: "Re: Forms that delete something"
- Previous message in Thread: Dean.Vasile@outlook.com: "Re: Forms that delete something"
- View all messages in this Thread