Email field
A text input with email-address validation and an email-friendly on-screen keyboard on mobile.
The Email field is a single-line text input pre-configured for email addresses. It validates the value against an RFC-5322-lite regex on blur and on submit, sets
inputMode="email" so mobile devices show the email keyboard, and disables autocorrect.
It binds to SharePoint's Text column type (SP doesn't have a dedicated Email column).
Common properties
| Property | Description |
|---|---|
labelstring | Visible label. |
descriptionstring | Helper text under the label. |
placeholderstring default: "name@example.com" | Greyed example text. |
requiredboolean default: false | Marks the field required. |
readOnlyboolean default: false | Disables editing. |
Type-specific properties
| Property | Description |
|---|---|
allowedDomainsstring[] | Optional allow-list. e.g. ["company.com"] rejects addresses outside those domains at validation time. |
multipleboolean default: false | Accept a comma-separated list of addresses. Each is validated individually. |
JavaScript recipes
Read & normalise the value
const email = (f365.field('ContactEmail').value ?? '').trim().toLowerCase();
Pre-fill from the current user
f365.events.onLoad(() => {
if (!f365.field('ContactEmail').value) {
f365.field('ContactEmail').value = f365.user.current().email;
}
});
Custom validation: reject free providers
const FREE = ['gmail.com', 'outlook.com', 'yahoo.com', 'hotmail.com'];
f365.field('ContactEmail').on('validate', (value) => {
const domain = (value ?? '').split('@')[1]?.toLowerCase();
if (FREE.includes(domain)) return 'Please use your work email address.';
});
Related
Related articles
- Text field
Single-line text input, the foundation field for names, codes, and short free-text.