# Form Field Validator

Validate a whole form locally: email, phone, URL, postal code, and credit card fields with required checks, locale hints, normalization, and JSON.

## Run it

- **CLI:** `gizza tool form-field-validator "email: john@example.com
phone: (415) 555-2671
zip: 90210
website: https://example.com
card: 4111 1111 1111 1111"`
- **Web:** https://gizza.ai/tools/form-field-validator/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/form-field-validator/tool.json

## Inputs

- `fields` — Fields (name: value, one per line or JSON object) _(field)_
- `country` — Country rules _(field)_
- `required` — Required fields _(field)_
- `rules` — Type overrides (field: type) _(field)_
- `normalize` — Normalize passing values _(field)_
- `mask_sensitive` — Mask credit-card digits _(field)_
- `output` — Output _(field)_

## Output

- Validation report (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `fields` — Fields (name: value, one per line or JSON object)
- `country` — Country rules
- `required` — Required fields
- `rules` — Type overrides (field: type)
- `normalize` — Normalize passing values
- `mask_sensitive` — Mask credit-card digits
- `output` — Output

Example: `https://gizza.ai/tools/form-field-validator/?fields=email%3A%20john%40example.com%0Aphone%3A%20%28415%29%20555-2671%0Azip%3A%2090210%0Awebsite%3A%20https%3A%2F%2Fexample.com%0Acard%3A%204111%201111%201111%201111&country=any&required=email%2C%20phone%2C%20zip&rules=zip%3A%20postal-code%0Acard%3A%20credit-card&normalize=true&mask_sensitive=true&output=text`

---

## About this tool

Use this form field validator when you need a quick, offline check of a whole submitted form rather than one value at a time. Paste `name: value` lines (or a JSON object), choose a country, mark required fields, and get a per-field report for common input types: email, phone, URL, postal code, credit card, and plain text.

Field types are inferred from names such as `email`, `phone`, `zip`, `postal_code`, `website`, `card`, and `cc_number`. Add rules like `zip: postal-code` or `support_url: url` when a field name is ambiguous. Country selection controls postal-code patterns and phone calling-code / national-length checks. The tool can normalize passing values and masks credit-card numbers by default.

This is a deterministic format validator. It does not perform DNS or MX checks, phone carrier lookups, address-existence checks, or BIN/issuer lookups. A passing result means the value is well formed for the selected rule; it does not prove the mailbox, phone number, address, or card account exists.

## Worked examples

Validate a US signup form:

```text
fields:
email: John.Doe@Example.COM
phone: (415) 555-2671
zip: 90210
website: https://example.com
card: 4111 1111 1111 1111

country: US
required: email, phone, zip
rules:
zip: postal-code
card: credit-card
```

The report starts with `VALID` when every required and typed field passes, shows normalized forms such as a lower-cased email domain and an E.164-style phone number, and masks card digits except the last four.

Find every issue in a broken form:

```text
fields:
email: john@
phone: 555-12
zip: 9021

country: US
required: email, phone, zip, website
rules: zip: postal-code
```

The output lists each failing field with the reason, expected format, and an example for the selected country.

## Supported checks and limits

- Inputs: up to 200 fields, as `name: value` lines or a JSON object.
- Field types: `email`, `phone`, `url`, `postal-code`, `credit-card`, and `text`.
- Required fields: blank, `*`, comma-separated names, or one name per line.
- Countries: `any` plus 38 country codes for postal-code and phone rules.
- Credit cards: length, brand prefix, and Luhn checksum only; no issuer lookup.
- Network checks: none. Everything runs locally and deterministically.

## FAQ

<details>
<summary>Does a valid email result mean the mailbox can receive mail?</summary>

No. This checks offline email syntax: one `@`, legal local/domain characters, label lengths, and a plausible alphabetic top-level domain. It does not query DNS, MX records, disposable-domain lists, or SMTP servers.

</details>

<details>
<summary>How are phone numbers validated?</summary>

With `country = any`, the phone check uses a generic E.164-style digit window. With a country code such as `US`, `GB`, or `DE`, it checks the calling code, accepted national digit length, and common trunk prefix handling. It is not a carrier-grade phone-number database or line-type lookup.

</details>

<details>
<summary>Can I validate postal codes for every country?</summary>

The tool includes a practical table of common postal-code formats for 38 countries and a generic `any` fallback. If a country has complex delivery-point rules, this tool checks the printed format only; it does not verify that a code is currently assigned or deliverable.

</details>

<details>
<summary>Why are credit-card numbers masked?</summary>

Masking is on by default so reports, screenshots, and logs do not expose full card numbers. The tool still uses the full input for brand and Luhn checks, then displays only the final four digits. Turn off `mask_sensitive` only when you explicitly need to inspect the exact normalized digits.

</details>

## Related tools

- [Email syntax validator](https://gizza.ai/tools/email-syntax-validator/): Validate email address syntax offline, flag disposable domains and role-based mailboxes, and get a pass/fail verdict with a low/medium/high risk grade.
- [Format Validator](https://gizza.ai/tools/format-validator/): Validate a value as an email address, URL, IPv4/IPv6 address, phone number, or credit card with Luhn check. Auto-detect formats locally in your browser.
- [Luhn Validator](https://gizza.ai/tools/luhn-validate/): Validate a credit card, IMEI, or any number against the Luhn check-digit algorithm — instantly, in your browser. Nothing is uploaded, free.
- [Absolute value, sign, or negation for a whole column](https://gizza.ai/tools/absolute-value-transformer/): Paste a column of numbers and apply absolute value, sign extraction (-1/0/1), sign flipping, or force-negative to every value at once, with rounding and an audit table.
- [Adjacency Matrix Converter](https://gizza.ai/tools/adjacency-matrix-converter/): Convert a graph between edge list, adjacency matrix, and incidence matrix — directed or undirected, weighted or not. Free, private, runs in your browser.
