DevSecOps: The Broken or Blurred Lines of Defense

With the modern patterns and practices of DevOps and DevSecOps, it’s not clear who the front-line owners are anymore. Today, most organizations' internal audit processes have lots of toils and low efficacy.

This is something John Willis, in his new role as Distinguished Researcher at Kosli, has referred to in previous presentations as “Security and Compliance Theatre.” 

40 Best UI Testing Tools And Techniques

A good User Interface (UI) is essential to the quality of software or application. A well-designed, sleek, and modern UI goes a long way toward providing a high-quality product for your customers — something that will turn them on.

A GUI is the first thing a user sees, so it must be clean and attractive. The look of a GUI can make or break an application, and the best way to ensure the user experience is great is to test your website or app using the best UI testing tools available in the market. In short, smart visual UI testing is crucial to closing design gaps and attracting users to the system.

Chris’ Corner: Gradients, Generators, and Glows

Radial gradients do represent a bit of a leap up in complexity compared to linear gradients in CSS. With linear gradients, you sorta pick a direction and plop some stops on there. The default direction, to bottom, you don’t even have to include if that’s the direction you want, and two color stops with no additional values just mean “all the way at the top to all the way at the bottom”. Something like this linear-gradient(darkblue, blue).

Good news: radial gradients do maintain making most parameters optional, so radial-gradient(darkblue, blue) is still functional and half-decently-useful. But the complexity goes up from there.

  • Radial gradients need to be told to behave like a circle if that’s the shape you want, not the default ellipse.
  • You can tell a radial gradient where to stop, before you even get to the color stops.
  • You can choose a starting position for the radial gradient, it doesn’t have to be dead center.
  • There are keywords that tell radial gradients to extend to certain relevant points of the container, like closest-side and furthest-corner and such.

It was enough for Patrick Brosset to ask Do you really understand CSS radial-gradients?, which, ya know, fair.

human eyes drawn with css radial gradients.

There is no built-in way to generate a random number in CSS. Maybe there should be, as there are countless demos that use some other technology to feed random numbers into CSS. The use case is often generative art or decorative effects, but there is so much of that and the results can be so cool, it’s almost shame we don’t have it. So what do we do to get random numbers in CSS?

  • We use the random function in a CSS processor (e.g. random() works in Sass) — but then it’s only random at build time.
  • We use a random number created in JavaScript, then set a --custom-property with it. Maybe even Houdini.
  • We use user input somehow to make a value feel random.

Kacper Kula’s Randomness in CSS kinda gets into all three of those. He uses a hand-built random number generator in Sass based on prime numbers. The @property syntax is used to ensure a custom property is an integer and is sometimes used as a seed that comes in via JavaScript.

Demo Pen

Let me leave you this week with just a tiny classy snippet of CSS from CodyHouse:

.component {
  /* inner glow 👇 */
  box-shadow: 
    inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075),

  /* shadow ring 👇 */
    0 0 0 1px hsla(0, 0%, 0%, 0.05),

  /* multiple soft shadows 👇 */
    0 0.3px 0.4px hsla(0, 0%, 0%, 0.02),
    0 0.9px 1.5px hsla(0, 0%, 0%, 0.045),
    0 3.5px 6px hsla(0, 0%, 0%, 0.09);
}
Demo Pen

That’s just a nice look right there.

The post Chris’ Corner: Gradients, Generators, and Glows appeared first on CodePen Blog.

Detect and Resolve Biases in Artificial Intelligence

This presentation is of the on-demand session by AWS Hero Virginie Mathivet at AWS re:Invent 2022 Las Vegas. Posted with permission.

Many applications get a bad buzz on the internet because of biases and discriminations in the models, but how can we avoid them? This talk presents the problem of biases, but also how to detect and fight them with cloud-agnostic solutions. We will examine solutions for biases at both the dataset level with statistical indicators, and at the model level thanks to eXplainable AI (XAI) algorithms.

Shallow and Deep Copies in JavaScript: What’s the Difference?

Have you ever tried to create a duplicate of an object in JavaScript, but the output wasn’t what you expected? If so, this article will discuss the different techniques for cloning and how to correctly utilize them. This knowledge will help guarantee that you get the correct results whenever you use the clone command.

In JavaScript, we can also create shallow copies and deep copies of objects. Let’s dive into what each of these concepts means in JavaScript.

JSON in Kotlin

In any web service that receives and transmits data to and from a server, the first and last events will usually be transforming the data from the format used by the web request into the format that the web server will handle, and vice versa; these operations are called deserialization and serialization, respectively. For some web services, the thought put towards this part of the flow of data is focused solely on how to configure the serialization mechanism so it works properly. However, there are some scenarios for which every CPU cycle counts, and the faster the serialization mechanism can work, the better. This article will explore the development and performance characteristics of four different options for working with the serialization of JSON messages—GSON, Jackson, JSON-B, and Kotlinx Serialization, using both the Kotlin programming language and some of the unique features that Kotlin offers compared to its counterpart language, Java.

Setup

Since its first release in 2017, Kotlin has grown by leaps and bounds within the JVM community, becoming the go-to programming language for Android development as well as a first-class citizen in major JVM tools like Spring, JUnit, Gradle, and more. Among the innovations it brought to the JVM community compared to Java was the data class, a special type of class that is to be used primarily as a holder of data (in other words, a Data Transfer Object, or DTO) and automatically generates base utility functions for the class like equals(), hashcode(), copy(), and more. This will form the base of the classes that will be used for the performance tests, the first of which being PojoFoo. “Pojo” stands for “Plain Old Java Object,” signifying using only basic class types of the Java programming language:

The Benefits of Open-Source ELT

Open-source technology is becoming increasingly popular in the data integration industry, and for good reasons. Open source creates the right incentives, allowing users to own their data entirely, unlike closed source, where you build knowledge in a proprietary tool with a price tag. Open source also creates communities around common problems, allowing for the exchange of valuable knowledge and collaborative problem-solving. 

In this article, we will start investigating the reasons behind the adoption success of open source before delving deeper into the data integration industry, more specifically focusing on open-source vs. closed-source ELT (Extract, Load, Transform) solutions. We will discuss how open-source ELT allows for greater control over the data integration process, more efficient data processing, and cost savings for organizations. Additionally, we will explore the growing trend of open-source ELT adoption in the industry and examine the future of open-source data integration. 

10 Tips To Optimize PostgreSQL Queries in Your Django Project

This article showcases optimization techniques that had great results at GitGuardian. You’ll find basic and advanced optimization techniques using Django and PostgreSQL, yet most of the principles we discuss are general enough to be applied to other frameworks or relational databases. However, a basic understanding of database transactions and how ORMs work is necessary to get the most out of it.

But don’t believe me, test them yourself! We provide a fully functional Django Playground where you can run all the queries shown in this article. Here it is.

How to Start an LLC in Nebraska in 10 Simple Steps

Starting an LLC is no easy task, but ZenBusiness and Incfile make it easier than ever for startups and new entrepreneurs to get off the ground. You can get started with ZenBusiness for as little as $0 (plus state filing fees) or register with Incfile for free now.

Most people start LLCs in tax-friendly states like Wyoming, South Dakota, and Nevada. But what most people don’t consider is that they also need to pay taxes in their home state. For some Nebraska business owners, this means registering an LLC in their home state.

The good news is that forming a Nebraska LLC is just as straightforward as in any other state. However, it does require some background knowledge of Nebraska state laws and regulations.

That’s why we’ve created this guide—to help you understand the process of forming an LLC in Nebraska.

How to Start an LLC in Nebraska in 10 Simple Steps

The 11 Best LLC Services for Starting an LLC in Nebraska

With countless LLC formation services out there, it’s safe to say that you won’t have to go through this process alone. But not all are created equal, which is why we created a list of the 11 best LLC services to get the job done.

Click here to read our reviews and decide which is best for you.

Start a Nebraska LLC in 10 Easy Steps

Starting an LLC in Nebraska can be beneficial for business owners who have customers, employees, or vendors located within the state. And it is a requirement for those who do business in the state, whether that is via an online or brick-and-mortar business.

The following ten steps will help you start an LLC in Nebraska:

  1. Name your LLC
  2. Choose a registered agent
  3. File your Certificate of Organization
  4. Create an operating agreement
  5. File an Affidavit of Publication
  6. Obtain any additional licenses and permits
  7. Obtain an employer identification number (EIN)
  8. Open a business bank account
  9. Comply with Nebraska state laws and regulations 
  10. Keep detailed records of all financial transactions

Every business is unique, so you may need to take additional steps depending on your situation. But by following these ten steps, you’ll have a solid foundation for launching your Nebraska LLC.

Step 1: Name Your LLC

The first thing you’ll want to do is come up with a name for your LLC. There are several ways to do this, and how you go about naming it will depend on the type of business you own and the level of recognition you want for your brand.

The most common business naming strategies include:

  • Using your name: Many business owners choose to use their own name as the official name of their LLC. This works best for sole proprietorships and single-member businesses (e.g., consulting businesses, freelance services, or creative projects) but can also be used for LLCs with multiple owners.
  • Using a basic keyword or phrase: Some businesses use a relevant keyword or phrase in their business name. For example, if you’re starting an accounting firm, you might call it “Nebraska Accounting Solutions.”
  • Using industry-specific terminology: Making up a name based on a word or phrase popular in your industry is a great way to connect with your target audience. For example, if you’re launching a website design company, you might choose to name it something like “DesignX.”
  • Choosing a random word or phrase: If you don’t have a specific name in mind, you can always choose a random word or phrase. This could be anything from your favorite song lyric to an obscure term that describes what you do.
  • Creating a unique word: Some business owners create unique words or phrases to use as their business name. This works especially well for tech startups and other innovative businesses.

If you aren’t sure what to call your business, you aren’t alone. Most business owners find naming their business to be one of the most challenging steps. That’s why it’s helpful to start by brainstorming a list of potential names and then narrowing it down from there.

A list of ChatGPT suggestions for online digital marketing business names
ChatGPT can help you think of a business name quickly, saving you time and effort. This is a sample prompt based on Quick Sprout’s business description.

If you don’t know where to start, you can try using ChatGPT to come up with a few names for you. All you need to do is enter a prompt and have it generate ideas that you can use. You can have fun with this and run the commands as many times as you’d like.

Once you have a few potential names in mind, you’ll need to make sure they are available by searching the Nebraska Secretary of State website. Your chosen name must be distinctive and not already registered with the state.

Then, check to ensure that the domain name you want is available for your chosen LLC name. Even if you don’t need a website right away, the right domain name can make or break your online presence later on.

If the URL you want is already taken, you may have to get creative and come up with a different name or an alternate domain extension. Alternatively, you could look into purchasing the domain from its current owner.

Step 2: Choose a Registered Agent

Every Nebraska LLC must appoint a registered agent to officially receive documents and legal notices on behalf of the business. This can be either an individual or a third-party service located in Nebraska.

The registered agent must have a physical street address in Nebraska and agree to accept any official mail sent by the state and any court summons. They must also be available during regular business hours to receive any documents that may need to be served.

You can act as your own registered agent, but we advise against it, and so do legal professionals.

Incfile free LLC landing page with header that says "Save Money and Time with Infile's $0 (+ state fee) LLC Registration"
Incfile helps entrepreneurs register their businesses and appoint a registered agent.

Fortunately, appointing a registered agent is easy. All you have to do is fill out a simple form and state the name and address of your chosen agent. And if the process seems confusing, you can use a business formation service like Incfile to do it for you.

Step 3: File Your Certificate of Organization

The Certificate of Organization is the official document that must be filed with the Nebraska Secretary of State to form a Limited Liability Company in Nebraska. It might sound like a challenging process, but it’s actually quite simple—fill out the form online and pay the filing fee.

To correctly prepare your Certificate of Organization, you’ll need to provide the following information:

  • The chosen name for your LLC
  • Your registered agent’s name and address
  • The address of your LLC headquarters
  • A statement of purpose detailing the purpose of your business
  • The professional services you offer (if any)
  • Details such as company membership and management structure
  • How long your LLC will exist. An LLC’s lifespan is indefinite in most cases, meaning it will exist for an unknown amount of time. This type of entity is known as a “perpetual” LLC and can be dissolved either voluntarily or involuntarily by its members. If your organization has been formed to meet a temporary objective with an expiration date attached, you should include the completion date here.
  • Names and addresses of the management team
  • The date of formation

Once you’ve completed the form, you’ll need to submit it along with the filing fee ($100). After you submit your Certificate of Organization, it will be reviewed by the state, and your business will become a legal entity once it is approved.

To file your Certificate of Organization and officially form your Nebraska LLC, visit the Nebraska Secretary of State website here.

Step 4: Create an Operating Agreement

An operating agreement is a document that outlines the operational rules, responsibilities, and rights of the members of an LLC. It is an important document that must be established before setting up a Limited Liability Company (LLC), as it helps ensure that everyone involved in the business knows what their roles, obligations, and duties are.

It also helps to clearly establish the relationships between all the members of the LLC, which makes it easier to resolve any disputes that may arise. And if you ever come up against legal trouble, having an operating agreement can help protect your business from liability. If you decide to do business without one, you will be subject to state operating laws and regulations that may not be favorable to your business.

Example of a Nebraska LLC Operating Agreement template
Creating your operating agreement online saves time compared to writing one out yourself.

Creating an operating agreement isn’t difficult, but it requires some research and planning. You’ll need to outline how decisions will be made, how profits and losses will be shared, what happens in the case of a dispute, and any other rules that you think are important. We recommend using an online drag-and-drop service that can help you create a customized Operating Agreement with minimal input from you and your stakeholders.

Step 5: File an Affidavit of Publication

If you’re creating a business in Nebraska, be aware that you must publish an announcement of your company’s formation within 45 days. This statement requires the name and place of the LLC itself as well as contact details for its registered agent. It should also include any professional services the business provides.

After this notice has been published for three consecutive weeks in one newspaper, said publication will submit their Affidavit of Publication to your LLC. Then you must then file it with the Nebraska Secretary of State.

Step 6: Obtain any Additional Licenses and Permits

Most businesses don’t need additional licenses and permits to operate legally in Nebraska. However, it’s important to check with your local government or the Secretary of State’s office to make sure you have all the necessary documents required by law.

For example, if you plan to sell alcoholic beverages or offer certain professional services, you must obtain a license specific to those activities. If your business is located in a specific city or county, you may also be required to get a special permit from that local governing body.

Some business models that require additional licenses and permits include:

  • Alcohol sales
  • Professional services (accountants, attorneys, etc.)
  • Construction
  • Child care
  • Real estate
  • Healthcare
  • Foodservice

Once you have obtained the necessary licenses and permits, you’ll be able to legally operate your Nebraska LLC.

Step 7: Obtain an Employer Identification Number (EIN)

An Employer Identification Number (EIN) is a unique nine-digit number issued by the Internal Revenue Service (IRS) to identify employers, sole proprietors, corporations, and other entities for tax purposes. This number is used to report business income, pay taxes, open bank accounts, hire employees, and just about anything else related to operating a business.

You can apply for an EIN online by visiting the IRS website here. It’s quick, easy, and free!

Step 8: Open a Business Bank Account

Even if your business doesn’t transact or turn a profit right away, it’s important to open a business bank account as soon as you can. This will help differentiate your personal finances from your company’s and make managing taxes and other financial responsibilities easier.

There are several benefits to having a business bank account:

  • It separates personal and business finances. When you open a business bank account, all of your income and expenses will be tracked in one place. That way, you can easily see how much money is coming in and out each month.
  • It helps establish credibility for your business. Having a separate bank account for your LLC shows you are serious about running a legitimate company.
  • It makes it easier to manage bookkeeping and taxes. Having a business bank account helps you keep track of all your expenses, which will help you stay organized and compliant with the IRS come tax season.
  • It can help establish business credit. You might be self-funded now, but if you want to apply for a loan or line of credit in the future, having a business bank account helps build your business credit.
  • It provides an easy way to accept payments from customers. With a business bank account, you can accept payments electronically, making it easier for customers to pay you.

When looking for a business bank account, look for one that offers features like free online banking, low monthly fees, good customer service, and access to other financial services such as merchant accounts and loans.

Step 9: Comply With Nebraska State Laws and Regulations

As a business owner, it’s important to understand the laws and regulations of your state. To ensure that you are compliant with Nebraska state law, consult an attorney or accountant who is knowledgeable in this area.

Relevant information includes:

  • Sales tax laws
  • Employment laws
  • Business insurance requirements
  • Contract and licensing laws
  • Environmental regulations
  • Health and safety regulations

Knowing the law is essential for running a successful business in Nebraska. It will help you avoid costly fines and penalties and ensure that you are providing a safe workplace for your employees and customers.

Step 10: Keep Detailed Records of All Financial Transactions

Bookkeeping is one of the most important aspects of running a business. Keeping accurate and up-to-date records of your income and expenses is essential. This includes receipts, invoices, bank statements, credit card statements, loan payments, and anything related to your business’s financial transactions.

These detailed records will come in handy when it comes time to file taxes and apply for loans or financing. They also provide you with a snapshot of your financial health and help you make sound decisions for the future.

Example of a QuickBooks user dashboard
QuickBooks is one of the best accounting tools available for small businesses.

The best way to stay on top of your finances is to use accounting software to keep track of your transactions. Popular options include QuickBooks, FreshBooks, and Xero. All of these programs are user-friendly and can help you streamline your bookkeeping process.

Final Thoughts About Starting an LLC in Nebraska

If you plan to do business in Nebraska, forming an LLC is the best way to protect yourself and your assets. You’ll need to register your business with the Secretary of State, obtain any necessary licenses or permits, open a business bank account, and comply with state laws and regulations.

Once you’ve done all of this, you can start operating as an LLC in Nebraska and enjoy the benefits that come with it. And most importantly, you can focus on running and growing your business.

Pascal Programming;

Write a pascal program that accept the name and date of your birth the program should then output your name and date of birth in the format your name and your date of birth e.g Pascal your date of birth is 20/10/2023

Monitor and Predict Health Data Using AWS AI Services

This is a recording of the breakout session at re:Invent 2022 Las Vegas by AWS Hero Luca Bianchi. Posted with permission.

Health systems lack the capability to account for comprehensive population health monitoring. Yet collecting data like oxygenation, temperature, blood tests, and glucose can identify the signs of underlying conditions early. Many home devices are connected and capable of acquiring and monitoring a vast number of vital signs to track a person's health across many relevant metrics. This talk will show how to build a serverless personal health solution leveraging AWS AI services to provide insight extraction, monitoring, and forecasting. Participants will see how to collect a time-variant dataset, use Amazon Lookout for Equipment to spot anomalies, and predict metrics levels.

A Guide To Accessible Form Validation

When it comes to form validation, we can explore it from two perspectives: usability and accessibility. “What’s the difference between usability and accessibility?” you may ask. Let’s start from there.

Usability

Usability is about improving a given action until it’s as easy and delightful as possible. For example, making the process of fixing an invalid field easier or writing better descriptions so the user can fill the field without facing an error message.

To get a really good grasp of the challenges in this process, I highly recommend you to read the deep-dive “Designing better inline validations UX” from Vitaly. There, you’ll learn about the different approaches to validate a field and what are the caveats and trade-offs of each one.

Accessibility

Choosing the best UX approach is just half of the challenge. The other half is ensuring that any person knows the field is invalid and easily understands how to fix it. That’s what I’ll explore through this guide.

You can look at ‘Accessibility’ and ‘Usability’ as two equally important universes with their own responsibilities. Accessibility is about ensuring anyone can access the content. Usability is about how easy it is to use the website. Once overlapped will take ‘User Experience’ to its best.

With these two concepts clarified, we are now ready to dive into accessible validations.

Accessibility In Forms

Before we get into validation, let me recap the accessibility fundamentals in forms:

  • Navigation
    The form can be navigated using only the keyboard, so people who don’t use a mouse can still fill and submit the form. This is mostly about setting a compliant focus indicator to each form control.
  • Context
    Each form field must have an accessible name (label), so people who use assistive technologies can identify each field. For example, screen readers would read a field name to its user.

Screen Readers In Forms

Similar to browsers, screen readers (SR) behave slightly differently from each other: different shortcuts, different semantic announcements, and different features support. For example, NVDA works better with Firefox, while VoiceOver works best with Safari, and both have slightly different behaviors. However, this shouldn’t stop us from building the common solid foundations that are strongly supported by all.

A while ago, I asked on Twitter how screen reader users navigate forms. Most prefer to Tab or use special shortcuts to quickly jump through the fields but oftentimes can’t do it. The reason is that we, developers, forget to implement those fields with screen readers in mind most of the time.

Currently, many of the field validations can’t be solved with native HTML elements, so we are left with the last resource: ARIA attributes. By using them, Assistive Technologies like screen readers will better describe a given element to the user.

Through the article, I’m using VoiceOver in macOS Catalina for all the scenarios. Each one includes a Copeden demo and a video recording, which hopefully will give you a better idea of how screen readers behave in forms, field descriptions, and errors.

The Field Instructions

Field Description

The field label is the first visual instruction to know what to fill in, followed by a description when needed. The same way sighted users can see the description (assuming a color contrast that meets WCAG 1.4.3 Contrast Minimum), the SR users also need to be aware of it.

To do so, we can connect the description to the input by using the aria-describedby attribute, which accepts an id pointing to the description element. With it, SR will read the description automatically when the user focuses on the field input.

<!-- note: highlight the aria-describedby -->
<label for="address">Your address</label>
<input id="address" type="text" aria-describedby="addressHint"/>
<span id="addressHint">Remember to include the door and apartment.</span>

In this field, it would cause more harm than good to connect the entire description to the aria-describedby. Instead, I prefer to connect a short description that hints to the user about the full description so they can navigate to it on their own.

<input id="days" type="text" aria-describedby="daysHintShort"/>
<div class="field-hint">
  <span id="daysHintShort" hidden>
    <!-- This text is announced automatically when the input is focused
    and ignored when the screen reader users navigate to it. -->
    Below it's explained how these days influence your benefits.
  <span>
  <div>Depending on how many days....</div>
</div>

As this short description is exclusive to assistive technologies only, we need to hide it from sight users. A possibility could be using the .sr-only technique. However, a side-effect is that the screen reader user would bump into it again when moving to the next element, which is redundant. So, instead, let’s use the hidden attribute, which hides the short description from assistive technologies altogether, but still lets us use the node’s contents as the inputs’ description.

<input id="days" type="text" aria-describedby="daysHintShort"/>
<div class="field-hint">
  
<span id="daysHintShort" hidden>
    <!-- This text is announced automatically when the input is focused,
    and ignored when the screen reader users navigates to it. -->
    Below it's explained how these days influence your benefits.
  </span>
  <div>Depending on how many days....</div>
</div>

I find this pattern very useful for fields with long descriptions or even complex validation descriptions. The tip here is to hint to the users about the full instructions, so they won’t be left alone guessing about it.

Visually most people will recognize this pattern. However, people who use SR will get confused. For instance, Voice Over will announce “Address star, edit text.” Some screen readers might completely ignore it, depending on how strict the verbosity settings are.

This is a perfect scenario of an element that, although it’s visually useful, it’s far from ideal for SR users. There are a few ways to address this asterisk pattern. Personally, I prefer to “hide” the asterisk using aria-hidden="true", which tells all assistive technologies to ignore it. That way, Voice Over will just say “Address, edit text.”

<label for="address" class="field-label">
  Address <span class="field-star" aria-hidden="true">*</span>
</label> 

The Semantic Clue

With the visual clue removed from AT, we still need to semantically tell the input is required. To do so, we could add the required attribute to the element. With that, the SR will say, “Address, required, edit text.”

<input id="address" type="text" required />

Besides adding the necessary semantics, the required attribute also modifies the form behavior. On Chrome 107, when the submit fails, it shows a tooltip with a native error message and focuses the required empty field, like the following:

The Flaws In Default Validations

Probably your designer or client will complain about this default validation because it doesn’t match your website aesthetics. Or your users will complain the error is hard to understand or disappears too soon. As currently, it’s impossible to customize the styling and behavior, so we’ll see ourselves forced to avoid the default field validation and implement our own. And just like that, accessibility is compromised again. As web creators, it’s our duty to ensure the custom validation is accessible, so let’s do it.

The first step is to replace required with aria-required, which will keep the input required semantics without modifying its style or behavior. Then, we’ll implement the error message itself in a second.

<!-- note: this would be a diff -->
<input id="address" type="text" required="required" />
<input id="address" type="text" aria-required="true" />

Here’s a table comparing side by side the difference between required and aria-required:

Function required aria-required
Adds semantics Yes Yes
Prevents invalid submit Yes No
Shows custom error message Yes No
Auto-focus invalid field Yes No

Reminder: ARIA attributes never modify an element’s styles or behavior. It only enhances its semantics.

The Error Message

From a usability standpoint, there’s a lot to take into consideration about error messages. In short, the trick is to write a helpful message without technical jargon that states why the field is incorrect and, when possible, to explain how to fix it. For a deep dive, read how to design better error messages by Vitaly and how Wix rewrote all their error messages.

From an accessibility standpoint, we must ensure anyone not only knows that the field is invalid but also what’s the error message. To mark a field as invalid, we use the ARIA attribute aria-invalid="true", which will make the SR announce that the field is invalid when it’s focused. Then, to also announce the error, we use aria-describedby we learned about before, pointing to the error element:

<input
  id="address"
  type="text"
  required="required"
  aria-invalid="true"
  aria-describedby="addressError addressHint"
/>
<span>
  <p id="addressError">Address cannot be empty.</p>
  <p id="addressHint">Remember to include the door and apartment.</p>
</span>

Invalid Field With Description

A good thing about aria-describedby is that it accepts multiple ids, which is very useful for invalid fields with descriptions. We can pass the id of both elements, and the screen reader will announce both when the input is focused, respecting the order of the ids.

<input
  id="address"
  type="text"
  required="required"
  aria-invalid="true"
  aria-describedby="addressError addressHint"
/>
<span>
  <p id="addressError">Address cannot be empty.</p>
  <p id="addressHint">Remember to include the door and apartment.</p>
</span>

Open the Pen Field Validations — aria-invalid by Sandrina Pereira.

The Future Of ARIA Errors And Its Support

An ARIA attribute dedicated to errors already exists — aria-errormessage — but it’s not yet supported by most screen readers. So, for now, you are better off avoiding it and sticking with aria-describedby.

In the meantime, you could check A11Ysupport to know the support of a given ARIA attribute. You can look at this website as the “caniuse” but for screen readers. It contains detailed test cases for almost every attribute that influences HTML semantics. Just pay attention to the date of the test, as some tests might be too old.

Dynamic Content Is Not Announced By Default

Important to note that although aria-describedby supports multiple ids, if you change them (or the elements’ content) dynamically while the input is focused, the SR won’t re-announce its new content automatically. The same happens to the input label. It will only read the new content after you leave the input and focus it again.

In order for us to announce changes in content dynamically, we’ll need to learn about live regions. Let’s explore that in the next section.

Moments Of Validation

The examples shown so far demonstrate ARIA attributes in static fields. But in real fields, we need to apply them dynamically based on user interactions. Forms are one of the scenarios where JavaScript is fundamental to making our fields fully accessible without compromising modern interactive usability.

Regardless of which moment of validation (usability pattern) you use, any of them can be accomplished with accessibility in mind. We’ll explore three common validation patterns:

  • Instant validation
    The field gets validated on every value change.
  • Afterward validation
    The field gets validated on blur.
  • Submit validation
    The field gets validated on the form submit.

Instant Validation

In this pattern, the field gets validated every time the value changes, and we show the error message immediately after.

In the same way, as the error is shown dynamically, we also want the screen reader to announce it right away. To do so, we must turn the error element in a Live Region, by using aria-live="assertive". Without it, the SR won’t announce the error message, unless the user manually navigates to it.

Open the Pen Field Validations - instant validation by Sandrina Pereira.

Some nice to know about this example:

  • While the input is valid, the aria-invalid can be "false" or be completely absent from the DOM. Both ways work fine.
  • The aria-describedby can be dynamically modified to contain one or multiple ids. However, if modified while the input is focused, the screen reader won’t re-announce its new ids — only when the input gets re-focused again.
  • The aria-live attribute holds many gotchas that can cause more harm than good if used incorrectly. Read “Using aria-live” by Ire Aderinokun to better understand how Live Regions behave and when (not) to use it.
  • From a usability perspective, be mindful that this validation pattern can be annoying, the same way it’s annoying when the error shows up too early while we are still typing our answer.

Afterward Validation

In this pattern, the error message is only shown after the user leaves the field (on blur event). Similar to the ‘Instant Validation’, we need to use the aria-live so that the user knows about the error before start filling the next elements.

Usability tip: I personally prefer to show the on-blur error only if the input value changes. Why? Some screen reader users go through all the fields to know how many exist before starting to actually fill them. This can happen with keyboard users too. Even sight users might accidentally click on one of the fields while scrolling down. All these behaviors would trigger the on-blur error too soon when the intent was just to ‘read’ the field, not to fill it. This slightly different pattern avoids that error flow.

Open the Pen Field Validations - afterward validation by Sandrina Pereira.

Submit Validation

In this pattern, the validation happens when the user submits the form, showing the error message afterward. How and when exactly these errors are shown depends on your design preferences. I’ll go through two of the most common approaches:

In Long Forms

In this scenario, I personally like to show an error summary message, usually placed right before the submit button, so that the chances of being visible on the screen are bigger. This error message should be short, for example, “Failed to save because 3 fields are invalid.”

It’s also common to show the inline error messages of all invalid fields, but this time without aria-live so that the screen reader doesn’t announce all the errors, which can be annoying. Some screen readers only announce the first Live Region (error) in the DOM which can also be miss-leading.

Instead, I add the aria-live="assertive" only to the error summary.

Open the Pen Field Validations - on submit - error summary by Sandrina Pereira.

In the demo above, the error summary has two elements:

<p aria-live="assertive" class="sr-only">
  Failed to save because 2 fields are invalid.
</p>
<p aria-hidden="true">
  Failed to save because 2 fields are invalid.
</p>
  1. The semantic error summary contains a static error summary meant to be announced only on submit. So the aria-live is in this element, alongside the .sr-only to hide it visually.
  2. The visual error summary updates every time the number of invalid fields changes. Announcing that message to SR could be annoying, so it’s only meant for visual updates. It has the aria-hidden so that the screen readers users don’t bump into the error summary twice.

Check the screen reader demo below:

In Short Forms

In very short forms, such as logins, you might prefer not to show an error summary in favor of just the inline error messages. If so, there are two common approaches you can take here:

  1. Add an invisible error summary for screen readers by using the .sr-only we learned above.
  2. Or, when there’s just one invalid field, focus that invalid field automatically using HTMLElement.focus(). This helps keyboard users by not having to tab to it manually, and, thanks to aria-describedby, will make screen readers announce the field error immediately too. Note that here you don’t need aria-live to force the error announcement because the field getting focused is enough to trigger it.

Open the Pen Field Validations - on submit - auto-focus by Sandrina Pereira.

Accessibility Comes Before Usability

I must highlight that this is just one approach among others, such as:

  • Error text: It can be just a simple text or include the number of invalid fields or even add an anchor link to each invalid field.
  • Placement: Some sites show the error summary at the top of the form. If you do this, remember to scroll and focus it automatically so that everyone can see/hear it.
  • Focus: Some sites focus on the error summary, while others don’t. Some focus on the first invalid field and don’t show an error summary at all.

Any of these approaches can be considered accessible as long it’s implemented correctly so that anyone can perceive why the form is invalid. We can always argue that one approach is better than the other, but at this point, the benefits would be mostly around usability and no longer exclusively about accessibility.

Nevertheless, the form error summary is an excellent opportunity to gracefully recover from a low moment in a form journey. In an upcoming article, I will break down these form submit patterns in greater detail from both accessibility and usability perspectives.

Testing Field Validations

Automated accessibility tools catch only around 20-25% of A11Y issues; the more interactive your webpage is, the fewer the bugs it catches. For instance, those tools would not have caught any of the demos explored in this article.

You could write unit tests asserting that the ARIA attributes are used in the right place, but even that doesn’t guarantee that the form works as intended for everyone in every browser.

Accessibility is about personal experiences, which means it relies a lot on manual testing, similar to how pixel-perfect animations are better tested manually too. For now, the most effective accessibility testing is a combination of multiple practices such as automated tools, unit tests, manual tests, and user testing.

In the meantime, I challenge you to try out a screen reader by yourself, especially when you build a new custom interactive element from scratch. You’ll discover a new web dimension, and ultimately, it will make you a better web creator.

Things To Keep In Mind For Accessible Fields

Auto Focusing Invalid Inputs

Above, I mentioned one possible pattern of automatically focusing the first invalid field, so the user doesn’t need to manually navigate to it. Depending on the case, this pattern might be useful or not. In doubt, I prefer to keep things simple and not add auto-focus. If not obvious, let the user read the summary error message, understand it and then navigate to the field by themselves.

Wrapping Everything Inside <label>

It might be tempting to wrap everything about a field inside the <label> element. Well, yes, the assistive technologies would then announce everything inside automatically on input focus. But, depending on how ‘extensive’ the input is, it might sound more confusing than helpful:

  • It’s not clear for screen reader users what exactly the label is.
  • If you include interactive elements inside the label, clicking on them might conflict with the automatic input focus behavior.
  • In unit tests (e.g., Testing Library), you can’t target an input by its label.

Overall, keeping the label separate from everything else has more benefits, including having grainier control over how elements are announced and organized.

Disabling The Submit Button

Preventing the user from submitting an invalid form is the most common reason to disable a button. However, the user probably won’t understand why the button is disabled and won’t know how to fix the errors. That’s a big cognitive effort for such a simple task. Whenever possible, avoid disabled buttons. Let people click buttons at any time and show them the error message with instructions. In the last instance, if you really need a disabled button, consider making it an inclusive disabled button, where anyone can understand and interact with it.

Good UX Is Adaptable

Most physical buildings in the world have at least two ways to navigate them: stairs and lifts. Each one has its unique UX with pros and cons suited for different needs. On the web, don’t fall into the trap of forcing the same pattern on all kinds of users and preferences.

Whenever you find an A11Y issue in a given pattern, try to improve it, but also consider looking for an alternative pattern that can be used simultaneously or toggled.

Remember, every person deserves a good experience, but not every experience is good for everyone.

Wrapping Up

Field validations are one of those web concepts without dedicated HTML elements that suit modern web patterns, so we need ARIA to fill in the gaps. In short, this article covered the most common attributes for field validations that make a difference for many people in their web journey:

  • aria-required: To mark a field as required.
  • aria-invalid: To mark the field as invalid.
  • aria-describedby: To connect the description and error message to the input.
  • aria-live: To announce dynamic error messages.

Accessibility is about people, not about ARIA. Besides those attributes, remember to review your colors, icons, field instructions, and, equally important, the validations themselves. Your duty as a web creator is to ensure everyone can enjoy the web, even when a form fails to submit.

Last but not least, I’d like to appreciate the technical review from Ben Mayers, Kitty Giraudel, and Manuel Matuzović. Because sharing is what makes us better. <3

WCAG References

All the practices we explored in this article are covered by WCAG guideline “3.3 Input Assistance”:

The more I learn about web accessibility, the more I realize accessibility goes beyond complying with web standards. Remember, the WCAG are ‘guidelines’ and not ‘rules’ for a reason. They are there to support you, but if you suspect a guideline doesn’t make sense based on your diverse user research, don’t be afraid to question it and think outside the box. Write about it, and ultimately guidelines will evolve too.

Shopify vs Shopify Plus: Which Is Better for an Ecommerce Store?

Shopify vs Shopify PlusThe basic Shopify service is an all-inclusive selling platform from which you can promote, sell, and ship products. Still, the company also offers an enterprise version, Shopify Plus, which is better suited for larger companies. In this article, we will compare these two platforms in terms of their pricing, features, integrations, and support and show you the key differences between them. So, let's get started!

Application Development: Types, Stages, and Trends

Application development has become an integral part of modern business operations. With the rapid growth of technology and the widespread use of mobile devices, the demand for software applications has increased manifold. Besides, from mobile apps to web applications, businesses require custom solutions that can cater to their specific needs and provide a seamless user experience.

In this article, we will discuss the various types of application development, the stages involved in the development process, and the latest trends in the industry.