14. Form Validation

The Problem

Business input needs rules such as text length, numeric ranges, and optional dates, with immediate feedback.

The React Difficulty

React normally leaves validation to the application or a form library. Developers define validation rules, error state, and display behaviour separately.

React Approach

function validateAge(value) {
    if (!value) return "Age is required";
    if (+value < 20 || +value > 80) return "Age must be 20–80";
    return "";
}

const error = validateAge(age);

MS Approach

ManySet provides a direct runtime-oriented approach for this recurring business-application task.

g.editFields = {
    Name: "text(30)",
    Weight: "decimal(10.5-80.5)",
    Age: "int(20-80)",
    Date: "date(23/02/18-23/04/26) optional"
};

Why this way is useful in business applications :

The comparison is intended to show where ManySet supplies a business-application abstraction around a recurring task, while keeping HTML and JavaScript visible and directly usable.

Key Point :

ManySet reduces the amount of framework-specific composition required for this particular task, without requiring the React/Angular mechanism to be represented as inherently wrong or incapable.