StrictlyJS: Comprehensive Example Gallery

Example 1: Basic Inputs

Demonstrates basic field validation and API usage.

Example 2: Direct Inputs (Live Validation)

Shows live validation with restrict: 'oninput'.

Example 3: Full Form Validation (All Built-in Rules)

Number & Digits Validation

Alphanumeric Validation

URL

Date & Time

Password Validation

Length, Range, Word

Pattern

Checkbox Validation

Select Validation

Node & Equal to

Demonstrates all built-in validation rules in a single form.

Example 4: Default (First Error Only)

Only the first error per field is shown at a time.

Example 5: All Errors Shown (errorReturnType: 'all')

All errors for a field are shown, separated by <br>.

Example 6: Using validate() API to Get Errors as Array

Errors are returned as an array and displayed below the form.

Example 7: Space Validations

Demonstrates data-strictly-initialnospace and data-strictly-singlespace validations. Try entering leading spaces or multiple spaces between words.

Example 8: File Input Validation

Demonstrates file type, size, and count validation for file inputs.

Example 9: Custom Error Placement (Summary at Top)

All error messages are shown in a summary box at the top, using the errorPlacement callback.

Example 10: Form-Level Callbacks (onValidate, onSuccess, onError)

Shows how to use onValidate, onSuccess, and onError callbacks to react to form validation state.

Example 11: Synchronous Custom Validator (Even Number, API)

Uses a synchronous custom validator for even numbers, validated via API.

Example 12: Asynchronous Custom Validator (Username Availability, API)

Uses an asynchronous custom validator to simulate a remote username check ("taken" is unavailable, 500ms delay).

Example 13: Multiple Custom Validators (Single Field, Multiple Rules)

Demonstrates multiple custom validators per field, including parameterized and non-parameterized rules.