How To Accessibly Disable A Form Button When Submitting With Ajax Using Vanilla JS

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

0
0
194
Welcome to CodeXpress Forum Script - Download NL script Free


No comments. Be first to post a comment.

Reply to this article


Welcome, Guest: Join to reply login to reply!

♣ Post Statistic

1 guest(s) viewing this topic

Related Post

How To Make Your Desktop Look Aesthetic [video] How To Create A Forum With Codexpress Nairaland How To Rank Smaller Websites On Google (fast) How To Write Conditional Statements In Go How To Make Money With Html, Css And Javascript Only How To Pick Topics To Put On The Homepage, Like That Of N

♣ CodeXpress Statistic

Welcome, Guest: Join CodeXpress Login

17 Members, 135 topics and 9 posts
Date: Friday 01 July 2022 at 03:30 AM

Top 5 Contributors

People who started the most discussions on codexpress.

  1. 17
  2. 92
  3. 3
  4. 11
  5. 1

Sections

CodeXpress / General:
Politics, Business, Investment, Career, Autos, Counties, Properties, Agriculture, Health, Travel, Family, Culture, Religion, Food, Pets, Romance, Diaspora, Africa, International Forum, World List Directory, How To,
Science/Technology:
Programing, Webmasters, Computers, Phones, Art, Graphics & Video, Technology Market, CSS, Innovation, PHP 7x, Vanilla JS, Software Updates,

♣ Users Online: (2)

0 Members and 2 Guests online in last 5 minutes!


Sections:

Autos, Culture, International Forum, Travel, Romance, Software Updates, Webmasters, CSS, Innovation, Vanilla JS, Events, Theatre/Comedy, Forum Games, Music/Radio, Poetry,

CodeXpress - Copyright © 2019 - 2022 Marshall Unduemi. All rights reserved. See How To Advertise.
Disclaimer: Every CodeXpress member is solely responsible for anything that he/she posts or uploads on CodeXpress.