E-commerce14 min read•

Ecommerce Website Development in Pune: Building the Checkout Address Form — Fields, PIN Code Validation, Autofill and Mobile Details

Which fields to ask, how to validate a six-digit PIN code, how to mark up autofill, mobile form details and a test plan for your checkout address step.

#ecommerce website development Pune#checkout address form#PIN code validation#autofill#WooCommerce and Shopify

The address section of a checkout should ask for as little as it can, label every field plainly, tell the browser what each field is so it can autofill, check the six-digit PIN code for format as the customer types, and show the customer what they entered before they pay. Done well, it saves the customer thirty seconds and saves you the support calls that follow a wrongly typed address. If you are choosing an ecommerce website development company in Pune, or reviewing your own store, the address form is a good test of care, because it is small, it is on every order, and it is nearly always built carelessly. This guide is the specification: the fields, the markup, the validation rules, the mobile details and a test plan.

It is written for store owners and the developers who work for them, on WooCommerce, Shopify or a custom build. It is about building the form. It does not cover courier selection, rates or fulfilment, which are separate decisions. Where a number or rule depends on a standard, we cite it; where it depends on your platform, we say so.

Why the Address Form Deserves Its Own Attention

Every order passes through this form, which makes it one of the highest-leverage pieces of your store. Three kinds of cost come from getting it wrong.

  • Abandonment. A long, confusing form gives people a reason to leave. Baymard Institute's checkout research consistently lists a long or complicated checkout process among the reasons shoppers abandon a purchase (Baymard). The address block is usually the longest part.
  • Wrong or incomplete addresses. A mistyped PIN code, a missing landmark or a phone number with a digit short leads to failed contact and returned parcels. Fixing it after the order costs staff time and the customer's patience.
  • Support load. Customers who spot an error after paying write to you to change the address, and that is a manual job unless you have built an edit window.

None of this needs fancy engineering. It needs a clear list of fields and a few validation rules. For the wider checkout, our guide on checkout optimisation for Indian online stores covers payment options and trust signals; this article goes deep on the address step.

Decide the Fields: Ask Less, but Ask the Right Things

Start from what you need to deliver the order and contact the customer, not from what a generic template offers. For an Indian store, a sound set is:

  1. Full name (one field)
  2. Mobile number (10 digits, and optionally a second number)
  3. Email address (for the receipt and tracking)
  4. PIN code (six digits)
  5. House or flat number, building or street (address line 1)
  6. Area, locality or landmark (address line 2)
  7. City or town (often filled from PIN code)
  8. State (a drop-down, often filled from PIN code)

One name field, not two

Many forms ask for first name and last name separately, which assumes a naming convention that does not fit everyone. People in India may have a single name, a long name or an order of names that does not map to "first" and "last". A single full name field is simpler and avoids errors. If your invoice software needs separate parts, split them on the server for your own use rather than forcing the customer to do it.

Landmark and area matter in India

Addresses in many Indian localities rely on landmarks and area names more than on street numbers. Make address line 2 clearly useful, with a label such as "Area, locality or landmark", and do not make it optional by hiding it. Do not require a field that many customers cannot fill: if "Address line 2" is mandatory and the customer has nothing to add, they will type a dot, and that dot goes into your data.

Separate billing and shipping only when needed

Default to "Billing address is the same as the delivery address", pre-ticked. Show the second address form only if the customer unticks the box. If you are collecting GST details for business buyers, keep the GSTIN field in its own optional "I need a GST invoice" section so that consumers do not see it; our guide to ecommerce compliance fields and legal pages describes where those fields sit.

Do not ask for what you will not use

Date of birth, gender and company name for every order are common extras that reduce completion and create data you must protect. Under India's Digital Personal Data Protection Act, 2023, you should collect personal data for a specified purpose and, as a practice, no more than you need; confirm the details with your legal adviser, and see our DPDP website compliance guide.

Mark Up the Form So Browsers Can Autofill

Browsers can fill an address form in a second, but only if the fields declare what they are. The HTML autocomplete attribute does this, and it is defined in the HTML Standard (WHATWG HTML Standard: autocomplete). MDN's reference lists the tokens (MDN: autocomplete attribute). A well-marked address block looks like this:

<label for="name">Full name</label>
<input id="name" name="name" autocomplete="name">

<label for="tel">Mobile number</label>
<input id="tel" name="tel" type="tel" inputmode="numeric"
       autocomplete="tel-national">

<label for="postal">PIN code</label>
<input id="postal" name="postal" inputmode="numeric" maxlength="6"
       autocomplete="postal-code">

<label for="line1">House no., building, street</label>
<input id="line1" name="line1" autocomplete="address-line1">

<label for="line2">Area, locality or landmark</label>
<input id="line2" name="line2" autocomplete="address-line2">

<label for="city">City or town</label>
<input id="city" name="city" autocomplete="address-level2">

<label for="state">State</label>
<select id="state" name="state" autocomplete="address-level1">...</select>

Why these choices

  • Real label elements, not placeholder text acting as a label. Placeholders vanish when typing begins, and screen readers handle labels better. See our guide to accessibility and the W3C-based checks for related rules.
  • type="tel" and inputmode="numeric" bring up a number keypad on phones. Avoid type="number" for PIN codes and phone numbers: it adds spinner arrows, accepts "e" and can strip formatting. The GOV.UK Design System recommends against type="number" for numbers that are identifiers, not quantities (GOV.UK Design System: text input).
  • maxlength="6" on PIN code stops overlong entry, but pair it with real validation, because a length limit is not a format check.
  • Order matters. Put PIN code first, or near the top, if you auto-fill city and state from it, so the customer enters less.

Also test that autofill works in the browsers your customers use. Chrome's documentation on payment and address forms explains how its autofill reads these attributes (web.dev: payment and address form best practices).

Validate Without Annoying People

Validation protects data quality, and bad validation drives customers away. Follow three principles.

1. Validate format, not existence

An Indian PIN code has six digits. India Post's description of the PIN system says the first digit identifies a region, and the code does not begin with zero (India Post: PIN code). A safe format rule is "six digits, first digit 1 to 9". This catches typos like five digits, letters or spaces without claiming to know whether the code is real.

^[1-9][0-9]{5}$

Checking that the PIN exists, and that it matches the selected city and state, requires a dataset or an API. Use your courier or aggregator's serviceability API if you have one, or a licensed data source. Do not scrape random websites and do not treat a failed lookup as an error that blocks the order: if the lookup service is down, accept the entry and flag it for a human check.

2. Validate when the customer leaves the field, not on every keystroke

Showing "invalid PIN code" after the first digit is rude. Wait until the field loses focus, or until six characters are typed, then show a message that says what is wrong and how to fix it: "PIN codes have 6 digits, for example 411009."

3. Keep the customer's input

If validation fails, never clear the form. Keep everything the customer typed, put focus on the first error, and explain in words, not only colour, so that the error is accessible. Link the message to its field using aria-describedby.

Phone numbers

Indian mobile numbers are ten digits. Accept spaces and a leading +91 or 0 by cleaning the input on the server, then validate the cleaned value. Show a hint like "10-digit mobile number, we use it for delivery updates". Say why you need it. If you send order updates over WhatsApp, say that too, and get consent; our guide on WhatsApp order updates covers how.

Autofill City and State From the PIN Code

Filling city and state from the PIN code removes two fields and several typing errors. It needs a reliable lookup, so build it with care.

  • Make it a suggestion. Fill the fields but leave them editable. A PIN code can cover more than one locality, and the postal name may differ from what the customer calls their area.
  • Handle failure quietly. If the lookup returns nothing, show the fields empty and let the customer type. Do not show an alarming error.
  • Cache lookups on your server to keep the form fast and reduce reliance on an outside service.
  • Do not send anything but the PIN code to the lookup service. Never send the full address to a third party without need and disclosure.

If you also check delivery availability, put that result near the product page and cart, not only at the final step. Our article on delivery estimates and order tracking on your store describes that build.

Mobile Details That Make a Difference

Most Indian ecommerce traffic is on phones, so test on a real mid-range device, not only on a desktop browser with a narrowed window.

  • Large tap targets. Inputs and buttons should be comfortable to hit with a thumb. The W3C's WCAG 2.2 sets a minimum target size of 24 by 24 CSS pixels as a baseline requirement and recommends larger (W3C: Target Size (Minimum)); aim above the minimum for primary controls.
  • Font size of at least 16px in inputs. Smaller text can trigger automatic zoom on some mobile browsers when a field is focused.
  • Visible labels above fields, not beside them.
  • The right keyboard for each field, as set by type and inputmode.
  • A sticky order summary or a clear total, so customers can see what they are paying without scrolling back.
  • No layout jumps when validation messages appear. Reserve space for messages so the button does not move under a finger.

If your store is slow on mobile, the form will feel worse; see our article on mobile speed for Indian small businesses.

Confirm Before Payment, and Allow a Short Edit Window

Show a review step

Before the customer pays, show the address as it will print on the label, and the phone number, with a clear "Edit" link. Seeing "Flat 4, Sunrise Apartments, 411009" laid out is how most people spot "Flat 5" or a wrong digit.

Offer an edit window after the order

A common support request is "please change my address". Decide a window, say until the order is packed, and let customers edit the address from the order confirmation page or the tracking link. Re-run validation when they save, log the change with a timestamp and tell your warehouse team. Our guide on the order confirmation page and transactional emails describes how to put this link where customers see it.

Cash on delivery needs extra care

If you accept cash on delivery, an incorrect address has a bigger cost because a refused parcel returns to you. Some stores confirm COD orders by a short SMS or WhatsApp message before dispatch. We describe how to build that into your site in building cash on delivery controls at checkout. Whether to use such checks is a business decision; the build is straightforward.

Platform Notes: WooCommerce, Shopify and Custom Builds

WooCommerce. The default checkout has address fields you can reorder, relabel or remove with filters or a checkout-fields plugin. Check that custom code keeps the autocomplete attributes. Block-based checkout and classic shortcode checkout behave differently, so test the one you use. Add PIN code format validation both in the browser and on the server, because browser-only checks can be bypassed.

Shopify. Shopify controls its checkout, so you have limited freedom: you can usually change which fields are required and their order in settings, and use platform features or apps for validation and for PIN code checks. Because checkout customisation depends on your plan and Shopify's current options, confirm what your store can do in Shopify's documentation or with your developer before promising a design.

Custom builds. You control everything and you therefore carry the responsibility: server-side validation, accessible error handling, secure storage of personal data and the lookup service. Save addresses in structured fields, not one free-text blob, so that labels, invoices and reports can use them.

For a comparison of the two common platforms and what a store needs from each, see Shopify vs WooCommerce for Indian D2C stores.

A Test Plan Before You Ship

Run these tests on a phone and a desktop, and keep the results.

  1. Autofill: use a browser with a saved address and confirm every field fills correctly, including state.
  2. PIN code format: try five digits, seven digits, letters, a leading zero and a space. Each should give a clear message and keep other fields intact.
  3. PIN lookup failure: block the lookup service and check that the customer can still finish.
  4. Phone formats: try +91 and a leading zero, spaces and dashes.
  5. Keyboard use: complete the form with Tab and Enter only.
  6. Screen reader: run a basic check with a screen reader to confirm labels and errors are read.
  7. Edit after order: change the address within the allowed window and confirm the warehouse sees the new one.
  8. Server-side check: submit invalid data directly to the endpoint and confirm it is rejected.
  9. Data check: place five test orders and read the stored addresses in the admin, looking for stray punctuation or blank lines.

Frequently Asked Questions

What fields should an Indian online store's address form include?

Full name, mobile number, email, PIN code, house or building and street, area or landmark, city and state. Add a GSTIN field only for business buyers who ask for a GST invoice, and avoid asking for details you will not use.

How do I validate an Indian PIN code on a checkout form?

Check that it is six digits and does not start with zero, for example with the pattern ^[1-9][0-9]{5}$. Format checking catches typos. Confirming that a PIN code exists or matches a city needs a data source or courier serviceability API.

Should I use type="number" for the PIN code field?

No. It can add spinner arrows and accept characters you do not want. Use a text input with inputmode="numeric", a six-character limit, and your own format validation so that the number keypad appears on phones.

How do I make my store's address form autofill in browsers?

Add the standard autocomplete attributes, such as postal-code, address-line1, address-line2, address-level2 for city, address-level1 for state and tel-national, and use real label elements. Test with a browser that has a saved address.

Can customers change their address after placing an order?

Only if you build that option. Decide how long the edit window stays open, usually until the order is packed, and let customers edit from the confirmation page or tracking link, with validation and a log of the change.

Building or Fixing a Checkout?

If your checkout form is long, confusing or producing bad addresses, Govindani Infotech, an ecommerce website development company at 2nd Floor, Landmark Plaza, 206 Satara Road, Parvati Paytha, Pune 411009, builds and repairs store checkouts on WooCommerce, Shopify and custom platforms. See our checkout system service and website creation services, then contact us or call 092019 58274.

Sources:

About the author: written by the Govindani Infotech ecommerce development team in Pune.

Need Help With Your Digital Strategy?

Govindani Infotech helps Indian businesses and NGOs build websites, run ads, and grow online. Contact us for a free consultation.