---
title: "URL"
description: "Collect an HTTP or HTTPS URL and reject unsafe protocols."
group: "Build forms"
order: 5
type: "reference"
parent: "fields"
keywords:
  - "url"
  - "link"
  - "http"
  - "https"
  - "validation"
updated: "2026-07-14"
---

The URL field collects a web address and stores it as a string.

## Options and validation

URL fields accept the shared `required`, `description`, `placeholder`, `visibleIf`, and `maxLength` options. A valid answer must include `http://` or `https://`. Other protocols like `javascript:` and `data:` are rejected, because a stored answer may later be rendered as a link.

The current schema won't add `https://` for you, and it doesn't test whether the destination is reachable.

## Add a URL field

In the dashboard, select **Add block**, choose **URL**, and use placeholder copy that shows the required protocol.

```ts
const websiteField = {
  id: "website",
  kind: "url",
  label: "Company website",
  placeholder: "https://example.com",
  maxLength: 2048,
} as const;
```

## Related

- [Short text](/docs/fields/short-text): Collect a handle or path that isn't a complete URL.
- [Schema and validation](/docs/schema): See how client and server validation stay aligned.
- [Security and boundaries](/docs/security): Treat respondent-provided links as untrusted input.
