WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Link vs Button for "Cancel"

for

From: Patrick H. Lauke
Date: Jan 12, 2018 2:00AM


On 08/01/2018 20:28, Renato Iwashima wrote:
> Hi,
>
> I have a form that contains a submit button and a cancel link. The "cancel"
> takes the user to another page thus behaves like a link.
>
> But because it is a destructive action and is related to the form, I wonder
> if it should actually be a button. If thats the case, does it mean I need
> to implement JS to actually route the user to navigate to a different page?
> Can I just leave it as a link?

Making the link a button doesn't make it any less destructive. And it
should be fairly well understood by users that if they've filled in a
form, and then activate a link to another page, that their form won't be
submitted and the data potentially lost.

If you're really concerned that users would accidentally hit "cancel"
(regardless of whether it's a link or a button) and lose data, a better
approach would be to pop up an alert letting them know that if they
cancel now, their data will be lost...but to be honest, that's overkill
I'd say (unless it's a REALLY long and complex form, where losing the
data accidentally would really be a great annoyance).

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke