Accessibility / Forms / Form Error Reveal
The Form Error Reveal bookmarklet identifies all required form fields that are empty and marks them as invalid. Finds inputs, textareas, and selects with `required` attribute or `aria-required="true"`, checks if they have no value, adds `aria-invalid="true"` to empty fields, inserts "Required" error messages visually below each field, and automatically focuses the first empty required field. Displays an alert with the count of fields needing input. Useful for testing form validation behavior.
WCAG SC 3.3.1: Error IdentificationWCAG SC 3.3.3: Error Suggestion
Run Form Error Reveal
Test run or drag to
bookmarklets bar to install
javascript:%21function()%7B%22use%20strict%22%3Btry%7Bconst%20e%3D%5B...document.querySelectorAll(%22input%2Ctextarea%2Cselect%22)%5D%3Blet%20t%3Dnull%2Cr%3D0%3Be.forEach(e%3D%3E%7Bconst%20n%3De.required%7C%7C%22true%22%3D%3D%3De.getAttribute(%22aria-required%22)%2Ca%3D%21(e.value%7C%7C%22%22).trim()%3Bif(n%26%26a)%7Bif(e.setAttribute(%22aria-invalid%22%2C%22true%22)%2C%21e.nextElementSibling%7C%7C%21e.nextElementSibling.matches(%22.a11y-msg%22))%7Bconst%20t%3Ddocument.createElement(%22div%22)%3Bt.className%3D%22a11y-msg%22%2Ct.style%3D%22color%3A%23b00020%3Bfont%3A12px%2F1.3%20ui-monospace%2Cmonospace%3Bmargin%3A4px%200%22%2Ct.textContent%3D%22Required%22%2Ce.insertAdjacentElement(%22afterend%22%2Ct)%7Dt%7C%7C(t%3De)%2Cr%2B%2B%7D%7D)%2Ct%26%26t.focus()%2Calert(r%3Fr%2B%22%20required%20fields%20need%20input%22%3A%22No%20empty%20required%20fields%22)%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fgithub.com%2Falejandrogiga98%2FA11y-Bookmarklets%5CnBookmarklet%20name%3A%20Form%20error%20reveal%5CnAuthor%3A%20alejandrogiga98%5CnLicense%3A%20MIT%20License%5Cn%22)%7Dcatch(e)%7Balert(%22Bookmarklet%20Error%3A%20%22%2Be.message)%7D%7D()%3B
← Back to all bookmarklets