Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

Reference · Form-associated address field

defineFieldfunction

Register the form field under its default or a custom tag, idempotently; safe on a server.

Import it

import { defineField } from "@johnmorrisdotca/address-plus/element";

Also exported from: @johnmorrisdotca/address-plus/element/define

Definition

function defineField(tagName?: string, registry?: CustomElementRegistry | undefined): void

Parameters

NameTypeDescription
tagName (optional)string

The tag name; address-field by default.

registry (optional)CustomElementRegistry | undefined

The browser registry, undefined on a server.

Examples

import { defineField } from "@johnmorrisdotca/address-plus/element";

defineField();
console.log(typeof defineField);
// → "function"
function

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.