Shipping Form in HTML — Working Code Template
An HTML shipping form — recipient name, address (with proper autocomplete), shipping method, delivery instructions. Browser autofill works correctly so customers complete it in two taps.
Every shipping form should use the WHATWG autocomplete tokens correctly. The address fields get `address-line1`, `address-line2`, `address-level1` (state), `address-level2` (city), `postal-code`, `country`. Recipient fields get `name`, `email`, `tel`. When all autocomplete attributes are set, browsers autofill the entire address from a saved profile in a single tap — completion time drops from 60 seconds to 5.
Separate address-line-1 and address-line-2 explicitly. address-line-1 is the street; address-line-2 is the apt/suite/unit. Some address autofill systems don't combine them correctly when there's only one field, leading to messy data. Two fields, both with the right autocomplete value, fixes it.
Shipping method radio buttons with prices in the label text. Default to the free option (`checked` on standard) so customers can submit without selecting if they're happy with the default. Calculate the actual cost server-side from the submitted value — don't trust the price in the label since attackers could spoof it client-side.
splitforms emails you the shipping request and stores it permanently. For real shipping workflows, webhook into ShipStation, Easyship, or Shippo — they accept the address payload directly and generate shipping labels automatically. For a custom shop, the webhook hits your /api/orders endpoint and your warehouse takes over.
How to set this up
Use the exact autocomplete tokens
address-line1, address-level1 (state), postal-code, country. Browser autofill works correctly only when these are right.
Separate address line 1 and line 2
Street and apt/suite/unit in two fields. Combining them creates messy data.
Default-check the standard shipping option
Customers can submit without selecting. Free standard is the modern default.
Validate the chosen method server-side
Don't trust the price in the label — attackers can spoof client-side values. Validate against your shipping rates on submission.
Correct autocomplete tokens, separate address lines, server-side cost validation.
Frequently asked questions
What autocomplete attributes should I use on a shipping address form?
address-line1 (street), address-line2 (apt/suite), address-level1 (state), address-level2 (city), postal-code, country. Plus name, email, tel on the recipient fields. Browser autofill works correctly only when these match WHATWG-defined values.
Should I combine address line 1 and line 2 into one field?
No. Separate fields with the correct autocomplete values produce cleaner data and play nicely with autofill. The line-2 field is optional; making it optional in HTML reflects reality.
How do I calculate shipping cost dynamically?
Server-side on submission. Take the chosen method + destination + package weight, look up rates in ShipStation/Easyship/Shippo, return the cost to your checkout page. Don't trust client-side cost values.
How do I generate shipping labels automatically?
Webhook from splitforms to your shipping API (ShipStation, Easyship, Shippo, EasyPost). They accept the address payload, return a label PDF and tracking number. Forward both to the customer.
Related guides
Ship the form, not the backend.
Free for 1,000 submissions/month. Email delivery, AI spam filtering, signed webhooks, real dashboard — all on the free plan. No credit card.
Get a free access key →