Keenan Pereira
CV (PDF) Mumbai

Lights

Write-ups

Phone and pincode checks that make every lead CRM-ready

A short phone number or a one-word name can make a lead useless, or get it refused by the CRM. How seven answers on AHA’s ads landing page become twelve clean Zoho fields.

27 Oct 2026 3 min readFrom the project Luxury home-automation landing page

The problem

A lead with a wrong phone number or no last name is useless to sales, or refused by the CRM.

The fix

The browser’s own checks, then a small script that maps each answer to the field sales uses.

7 → 12
answers to CRM fields
10 · 6
digits: phone · pincode
0
validation libraries

Every enquiry from AHA’s ads landing page goes straight into Zoho CRM, the database the sales team works from. That makes the form the last quality check before a lead reaches a person. A phone number one digit short is a lead nobody can call, and a lead with no last name is one Zoho won’t accept at all.

Seven questions a consultant needs

The form asks for what a consultant needs before the first call, and nothing more:

  • Name, at least two characters.
  • Phone, exactly 10 digits.
  • Pincode, exactly 6 digits.
  • Project stage: renovation, new home or existing home.
  • Property type: 2 BHK up to 5 BHK and above, or other.
  • Preferred centre: Santacruz, Lower Parel, or “I would like a call first”.
  • Has your interior work started? Yes or no.

That last centre option matters. Not everyone who taps an ad is ready to visit a showroom, and it gives them a way to say so without leaving the page.

Let the browser do the checking

I didn’t add a validation library. Browsers already know how to check a form, and they do it before the form’s own script ever sees the submission:

<input type="tel" name="phone" required
       pattern="[0-9]{10}" inputmode="numeric" maxlength="10"
       title="Enter a valid 10-digit phone number">
  • pattern accepts exactly ten digits, and maxlength stops an eleventh.
  • inputmode="numeric" opens the number pad on a phone, so nobody hunts for digits on a full keyboard.
  • title is added to the browser’s message when the pattern doesn’t match.

The pincode works the same way with six digits. The three dropdowns start on a hidden blank option, so required forces a real choice instead of quietly accepting the first item in the list.

Before sending, the form script asks once more. If checkValidity() fails, it calls reportValidity(), which shows the browser’s own message beside the first problem field, and stops there. That step went in on 20 June, a day after the first version.

Shape the lead for the person who calls it

A valid form isn’t yet a useful lead. The script, built with Claude Code, turns 7 answers into 12 Zoho fields:

  • The name is split. The first word becomes the first name and the rest the last name. Zoho requires a last name, so a one-word name fills both, rather than the CRM turning the lead away.
  • The phone number goes in twice, as Phone and as Mobile, so it’s there whichever field a list shows.
  • The pincode lands in Zip Code, and the property answers in their own fields.
  • Three values are set automatically: source “Web Site”, status “Not Contacted” and city “Mumbai”. Every new lead arrives marked as new and not yet called.

A button that tells the truth

While a lead is on its way, the button reads “Sending…” and can’t be pressed again, so an impatient double tap can’t create two leads. If the request fails, the button shows a “please try again” message for 3 seconds, then resets, with everything the visitor typed still in place.

On success, the first version simply changed the button to “We’ll be in touch!”. Since 9 July it opens a thank-you page that says what happens next: a consultant will call within 24 hours.

What the checks don’t cover yet

Two gaps are worth naming:

  • The interior question is optional, and a blank is saved as “No”. It should either be required or send an honest blank, so sales can tell “no” from “didn’t say”.
  • The rules live only in the browser. The endpoint that forwards leads to Zoho passes them on as they arrive, so the same checks belong there too. A browser check helps the visitor; only a server check protects the CRM.

Rules I’d reuse

  1. Start with the browser’s own checks. They’re free, instant and familiar on every phone.
  2. Open the right keyboard. On a phone form, inputmode does more than any styling.
  3. Never let a required CRM field depend on how someone types their name.
  4. Offer a softer option. “Call me first” is still a lead.
  5. Give optional questions an honest blank.

Keep reading

Esc
↑↓ moveEnter openTry “party”