URL field

A text input for web addresses, clickable when read-only, validated for valid URL syntax on submit.

The URL field captures a web address. In edit mode it's a text input with URL validation; in read-only/display mode it renders as a clickable link. Binds to SharePoint's Text column.

For SharePoint Hyperlink or Picture columns (which store a separate label), use the Hyperlink field instead.

Common properties

PropertyDescription
label
string
default: Website
Visible label.
description
string
Helper text.
required
boolean
default: false
Marks the field required.
readOnly
boolean
default: false
Disables editing, the address still renders as a clickable link.

Type-specific properties

PropertyDescription
placeholder
string
default: https://
Placeholder shown in the empty input.
pattern
string (regex)
Custom validation regex the entered URL must match. Layered on top of the built-in URL-syntax check.
patternMessage
string
Error message shown when the value fails pattern.

JavaScript recipes

Read and set the address

const site = f365.field('Website').value as string | null;
f365.field('Website').value = 'https://example.com';

Normalize a bare domain to https on change

f365.events.onChange((e) => {
  if (e.fieldKey !== 'Website') return;
  const v = String(e.newValue ?? '').trim();
  if (v && !/^https?:\/\//i.test(v)) {
    f365.field('Website').value = `https://${v}`;
  }
});

Block save when the URL is invalid

f365.events.onBeforeSave(() => {
  const { valid } = f365.field('Website').validity();
  if (!valid) {
    f365.ui.showToast('Enter a valid website address before saving.', 'error');
    return false;
  }
  return true;
});

Related articles

  • Hyperlink field

    A SharePoint Hyperlink-or-Picture column, URL + display label stored together.

  • Text field

    Single-line text input, the foundation field for names, codes, and short free-text.