WhatsApp

How to Create a WhatsApp Contact Form

Create a client-side form that validates fields, composes a message and opens a wa.me link safely.

By FormToInbox6 min readUpdated 2026-09-03

A WhatsApp form does not submit to a traditional endpoint. After validation, it assembles the selected values and opens a WhatsApp chat with a URL-encoded message.

Use the business’s own number

The destination belongs to the site owner using the generated form. Store only digits in international format and never hard-code a different owner’s number into a reusable template.

Build a readable message

Include field labels, omit empty optional fields and put each value on its own line. Use encodeURIComponent before appending the message to the wa.me URL.

const lines = ['New website enquiry', 'Name: ' + name, 'Topic: ' + topic];
const url = 'https://wa.me/' + phoneDigits + '?text=' + encodeURIComponent(lines.join('\n'));
window.open(url, '_blank', 'noopener,noreferrer');

Explain the handoff

Opening WhatsApp is not the same as sending. The visitor can review and edit the message before they choose to send it. Make that transition clear near the submit button.

Keep a non-JavaScript fallback

If the flow depends on JavaScript, provide a simple contact alternative or an explanatory message. Do not silently discard the visitor’s input.

Frequently asked questions

Does FormToInbox receive the message?

No. In WhatsApp export mode the generated code composes the message in the visitor’s browser and opens wa.me.

Should the number include a plus sign?

The generated URL should use digits in international format. The builder normalizes spaces, brackets, dashes and a leading plus sign.

Is the message sent automatically?

No. WhatsApp opens with a prepared message and the visitor decides whether to send it.

Primary sources

Turn the guide into a working form

Start from a template, change the fields and take the code with you.

Open the free builder
Global privacy
Necessary storage

Keeps your form-builder draft and privacy choice on this device.

Always on
Sale or targeted-ad sharing

FormToInbox does not sell personal information or share it for cross-context behavioural advertising.

Off