When working with forms in Bootstrap, you can use the native validation attributes such as `required`, `minlength`, and `maxlength` on form controls. However, to take it to the next level, you can use JavaScript to create custom validation rules. This article will guide you through the process.

### Using the `validate` function

To start, let's take a look at a basic JavaScript function called `validate` that checks for three types of validation: required, range underflow, and range overflow.

```javascript
function validate(inputID) {
const input = document.getElementById(inputID);
const validityState = input.validity;

if (validityState.valueMissing) {
input.setCustomValidity(