CodeXpress

Welcome, Guest: Join CodeXpress Log In!

Stats: 11 Members, 99 topics and 9 posts Date:  Saturday 31 October 2020 at 11:04 PM

This is a product of CodeXpress Buy License for your website

How to accessibly disable a form button when submitting with Ajax using vanilla JS

CodeXpress / Science/Technology / Vanilla JS / How to accessibly disable a form button when submitting with Ajax using vanilla JS

23 people viewed

How To Start Your Web Development Career On A Rock-solid Foundation How To Make Your Themes Border Round Like Nairaland How To Write Conditional Statements In Go How To Think Like A Developer
(Go Down) (» Reply topic)
How to accessibly disable a form button when submitting with Ajax using vanilla JS by Marshallunduemi(): Wed 08, July, 2020
If you have a form that gets submitted using a JavaScript Ajax call (via an API or something) instead of a page reload, you might want to disable the submit button so that the user doesn’t try to resubmit the form while you’re waiting for the API to return a response.

Today, I’m going to show you how to do that without breaking accessibility for people who use assistive technology like screen readers.

Hint: you shouldn’t just slap a [disabled] attribute on it.

The problem with the [disabled] attribute #

I often see people do something like this with their button while the form is submitting

Read more from Go Make Things Website

Welcome to CodeXpress Forum Script - Download NL script Free
(» Go Up)

You must Sign in or Sign Up to post content

For you to post content on this website you have to log in or register, it only take few minute to create account

Go Up

Recommended for you

How To Write Conditional Statements In Go How To Show And Hide Elements With Vanilla Javascript How To I Change The Red Links On The Codexpress Nairaland Script How To Accessibly Disable A Form Button When Submitting With Ajax Using Vanilla Js

Currently: 1 guest(s) reading this article

Developed by Codexpress Programming Labs
Post content
Powered by Marshall