## Basic Validation

Basic validation involves type checks and mandatory checks based on the `sectionset` configuration. Here's how you can use basic validation in your form validation process:

### `sectionset` Configuration

The `sectionset` configuration is an array of sections, where each section contains fields with validation rules. Example `sectionset`:

```js
[
  {
    id: 'section - 1',
    title: 'Sign Up',
    fields: [
      { id: 'user_mail', validation: 'email' },
      { id: 'user_phone', validation: 'phone' }
    ]
  }
];
```

In this example, the `sectionset` contains a "Sign Up" section with two fields, each having a `validation` property. The `validation` property can be one of the following:

1. **Validation as a String**: You can use predefined validation types like `email` and `phone`. These types are built-in and are used to perform type checks.
   **Supported Types:- **

   1. `replay_email` Regex: <code>/^[\w\+\#]([\w-.+'&/#]*)@([\w\-\.]\*)(\.[a-zA-Z]{2,22}(\.[a-zA-Z]{2}){0,2})$/</code>
   2. `email` Regex: <code>/^[\w]([\w-.+']*)@([\w\-\.]\*)(\.[a-zA-Z]{2,22}(\.[a-zA-Z]{2}){0,2})$/</code>
   3. `phone` Regex: <code>/^[0-9a-zA-Z_()\+\-\.\$@\?\,\:\'\/\!\s]+/</code>
   4.

2. **Validation as an Object**: When using validation as an object, you must provide a `type` property, and you can include additional configuration options specific to the validation type.

   Example:

   ```js
   { id: 'user_mail', validation: { type: 'enum', allowedValues: ["value1", "value2"] } }
   ```

   The object structure varies based on the `type` specified, but the `type` key is mandatory.
   **Supported Types:- **

   1. `string` string: (value, {type: 'string', regex: custom regex, minLength = 0, maxLength = Infinity, errorMessage })
   2. `enum` enum: (values, { allowedValues = [], errorMessage: custom_error_message})

3. **Validation as a Function**: You can provide a custom validation function. When using a function, the function must follow a specific return format.

   Example:

   ```js
   { id: 'custom_field', validation: customValidationFunction }
   ```

   Custom validation functions allow you to define complex validation logic. The function should return the validation result in a specific format.

**Return Format**

```js
{
 isValid: true,
 isEmpty: false,
 errorMessage: 'message'
};
```
