# MentorFormExtensions class

> The MentorFormExtensions class of Novior.MentorAgent.Abstractions.Interfaces: A page's form as a UI action the model can fill: fill_<form>, with the fields…

- URL: https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/mentorformextensions
- Verified with: MentorAgent 1.5.0
- Last updated: 2026-11-26
- Packages: Novior.MentorAgent.Abstractions

A page's form as a UI action the model can fill: `fill_<form>`, with the fields to fill as its parameter. The action fills the fields, as the user would type them, and never submits the form: sending it stays an action of the application's own, with its confirmation if it writes.

## Definition

Namespace: `Novior.MentorAgent.Abstractions.Interfaces`. Package: `Novior.MentorAgent.Abstractions`.

`public static class MentorFormExtensions`

```shell
dotnet add package Novior.MentorAgent.Abstractions
```

## Methods

### `RegisterForm`

`public static IMentorPageContext RegisterForm<TModel>(this IMentorPageContext page, string name, string description, IJSRuntime js, Action<MentorFormOptions>? configure = null)`

Registers the form whose model is `TModel` as the UI action `fill_<name>`.

The fields are the public properties of `TModel` with a getter and a setter, of a simple type: text, number, `Boolean` (a checkbox), an enum (a select, whose options read the enum's names), `Guid`, a date or a time. Each field is found in the page by its `data-mentor-id`, `"<name>.<field>"`, the field written as the model sees it (`customerName`), unless [`MentorFormOptions.Selector`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/mentorformoptions#selector) gives another selector.

A sensitive field is never offered unless [`MentorFormOptions.IncludeSensitive`](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/mentorformoptions#includesensitive) names it: a property with `[DataType(DataType.Password)]`, `[DataType(DataType.CreditCard)]` or `[PasswordPropertyText]`, or whose name says it holds a password, a secret, a token, a PIN, a card's number or code, an IBAN or a one-time code. In the page, a password field is never written either, whatever its property.

The steps run in the browser through `js`, the page's own `IJSRuntime`: on Blazor Server, WebAssembly and MAUI Hybrid alike. A field that is not in the page, hidden, disabled, inside `data-mentor-exclude` or a password field fails the action, which the gate reports as failed.

**Parameters**

- `page`: The page's context.
- `name`: The form's name: letters, digits, `_` and `-`; the action is `fill_<name>`.
- `description`: What the form is, for the model and for the decisions ("The new order's form").
- `js`: The page's JavaScript runtime (`@inject IJSRuntime JS`).
- `configure`: Fields left out, sensitive fields let in, selectors of the page's own.

---

- Previous: [IMentorTour interface](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/imentortour.md)
- Next: [MentorFormOptions class](https://docs.mentoragent.net/api/novior-mentoragent-abstractions-interfaces/mentorformoptions.md)
