Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Telephone number field in forms


StaceyR

Question

Squarespace forms utilize three separate fields (or four, if country code is used) for telephone numbers. Unfortunately, this seems to prevent smartphones / personal computers from using their autofill feature to fill in the information automatically. It also necessitates tabbing at least twice to fill in the telephone number manually. I could replace the telephone number field with a text field to address the tabbing issue, but the autofill feature still wouldn't work. Is anything in the works to address this, or is there a workaround?

Edited by StaceyR
Initial Revision
Link to post
  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

You're right, it's best to use a Text field instead of the fixed Phone field as it is too inflexible on a website that will be used worldwide. The field can be assigned the type attribute of "tel" t

2 answers to this question

Recommended Posts

  • 0

You're right, it's best to use a Text field instead of the fixed Phone field as it is too inflexible on a website that will be used worldwide.

The field can be assigned the type attribute of "tel" to instruct browsers to offer autocomplete of a telephone number. This must be done by using JavaScript in the site injection area.

FIrst you must identify the field on your form then add the attribute.


phoneField=document.querySelector("some query string here");
phoneField.setAttribute ("type", "tel");

This is a simplified example to get you started.

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digital, a specialist company helping Squarespace users by building the features that Squarespace didn't include.
Explore our range of Squarespace Extensions, including the Wishlist, and Datepicker Extension or book a Squarespace Expert for 1:1 help. Note that links in my posts may be affiliate links.

Link to post
  • 0

Hi Paul2009, Thanks for this. I was able to replace the phone field with a text field, and it autofilled without my having to do a code injection, which is good because I don't know JavaScript! I tested the change with an Apple device; hopefully it works with other device types as well.

Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...