Menu

1 / 2

Make your contact form 2x faster to fill on phones: autocomplete and inputmode in 10 minutes

DEV Community: html·Rahil Khan·about 23 hours ago
#kUdbIOZL
#devto2#devto#dev#phone#fullscreen
Reading 0:00
15s threshold

Most small-business contact and booking forms are filled in on phones. Two tiny HTML attributes decide whether that takes 10 seconds or a minute of fiddly typing: autocomplete and inputmode . Most themes leave both out.

1. Let the browser fill details for the visitor

Phones already know the visitor's name, email, phone number and address. Tell the browser which field is which, and it offers to fill them in one tap:

<input name= "name" autocomplete= "name" > <input name= "email" type= "email" autocomplete= "email" > <input name= "phone" type= "tel" autocomplete= "tel" > <input name= "city" autocomplete= "address-level2" > <input name= "zip" autocomplete= "postal-code" inputmode= "numeric" >

Enter fullscreen mode

Exit fullscreen mode

Avoid autocomplete="off" on contact fields. It doesn't make anything safer here; it only slows people down.

2. Show the right keyboard

type="tel" opens the number pad, type="email" adds the @ key.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.