How to Handle Validation Errors When a Form Field Gets Disabled
A checkout form asks for a company name only when the buyer ticks “I am buying for a company”. The buyer ticks the box, presses Continue with the name empty, and gets a red field with “Enter the company name”. Then they change their mind and untick the box, and the form disables the company fields.
What should the red border and the message do now? The field cannot be edited, its value will not be submitted, and nothing the user can do in it will fix it. An error that stays on it is an instruction nobody can follow.
The browser already has an answer to this, and form validation written in JavaScript often gives a different one without anyone having decided so. This guide shows what the browser does, which property to ask, and how to write validation code that takes an error off a field when it is disabled and puts it back when the field is enabled again.
How to Build an OTP Input: One Real Input or One per Digit
A verification code field usually looks like a row of boxes, one per
character. There are two ways to build it. You can render one <input> per
box and move the focus from box to box, or you can render one real <input>
and draw the boxes underneath it from its value and its selection.
The two look the same, but they are not the same amount of work. A field per digit splits one value over six editors, so it has to rebuild, box by box, how text is replaced, composed, undone and autofilled, and a screen reader meets six fields instead of one. A single input keeps the browser’s editing model, the undo history of the edits that go through it, and one name for the whole code; the script still handles the slot selection, IME composition and text inserted several characters at once. This guide compares the two models, then builds the single input with that short list.
How to create reusable form components in React
Forms are the backbone of most web applications, but managing repetitive boilerplate for every input field can quickly lead to an unmaintainable codebase. As the creator of CoreUI, I’ve architected dozens of high-performance form systems for complex enterprise dashboards. The most efficient approach involves building a suite of primitive components that encapsulate styling, accessibility, and validation logic while remaining flexible via props. This modular strategy is exactly what we use to build our React Dashboard Template for maximum developer productivity.
How to build a todo app in Angular
Building a todo app in Angular is the ideal project for learning reactive state management, reactive forms, and component communication patterns in a realistic context.
As the creator of CoreUI with Angular development experience since 2014, I use this project structure as a reference for the correct separation of concerns between a service for state, a store service for data, and components for display.
The state lives in an injectable service using BehaviorSubject so any component in the tree can subscribe to todo changes reactively.
This pattern scales from a simple todo app to complex enterprise state management.
How to build a settings page in Angular
A settings page organizes application configuration into logical sections — account details, notifications preferences, security settings, and integrations — each in a separate tab or card. As the creator of CoreUI with Angular development experience since 2014, I’ve designed the settings page structure in CoreUI Angular templates that handles the separation of concerns between different settings categories. The key is using Angular’s tab navigation to organize sections, reactive forms for each section, and saving changes independently so updating notifications doesn’t require re-entering account details. Each settings section should be a standalone component with its own form and save button.
How to build a profile page in Angular
A user profile page combines several features: displaying current user data, an editable form for updating details, avatar upload, and a separate password change section. As the creator of CoreUI with Angular development experience since 2014, I’ve built the profile page components in CoreUI Angular templates that thousands of enterprise developers use as their starting point. The key is splitting the page into focused components — a profile info form and a security settings form — so each has clear responsibility and independent validation. Pre-populating forms from the current user data and handling partial updates cleanly is the most important implementation detail.
How to build a signup page in Angular
A signup page in Angular requires a reactive form with custom validators for password confirmation, client-side validation before submission, and an HTTP call to register the user on the backend. As the creator of CoreUI with Angular development experience since 2014, I designed the registration components in CoreUI Angular templates that handle the complete sign-up flow including error handling and success redirects. The most important custom validation pattern is the password confirmation check — Angular’s built-in validators don’t cover cross-field validation, so you must write a custom group validator. This validator compares two fields and marks the confirmation field as invalid if they don’t match.
How to build a login page in Angular
A login page in Angular requires a reactive form with validation, an auth service that calls your backend and stores the JWT, and a route guard that redirects unauthenticated users. As the creator of CoreUI with Angular development experience since 2014, I’ve built the authentication flows in CoreUI Angular templates used by thousands of enterprise developers. The key is separating form logic, HTTP calls, and token storage into distinct layers so each piece is independently testable. A login page that looks professional and handles errors gracefully significantly impacts first impressions of your application.
How to preview images before upload in Angular
Showing a preview before uploading gives users immediate confidence that they selected the right file, dramatically reducing mistakes and re-uploads.
As the creator of CoreUI with Angular development experience since 2014, I include image preview in every avatar upload or gallery feature in CoreUI Angular templates.
The browser’s FileReader API reads the selected file as a Data URL and Angular’s change detection updates the preview image source reactively.
This requires no libraries — just the native File API and a reactive component property.
How to build a checkout page in React
A checkout page combines form validation, order summary display, and payment processing into one of the most complex flows in any e-commerce application. As the creator of CoreUI, I’ve built checkout pages for multiple production e-commerce platforms and the key is breaking it into focused sections: shipping, payment, and order review. Each section should be a separate component with its own validation, and the parent page coordinates the multi-step flow. This structure keeps the code manageable and makes it easy to add, remove, or reorder steps.