Jump to content

Auto-filling Phone number in a text field

Recommended Posts

Site URL: https://www.airplushvac.com/contact

Hey team,

I tried using this JavaScript code block below based on another forum response to auto-fill saved phone numbers within a text field:

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

This doesn't seem to work for me when I target the CSS Selector in place of some query string here.

Can anyone enlighten me as to what I'm doing wrong? I'd like to have this autofill function work.


Edited by Jeton
Link to comment
  • Replies 0
  • Views 380
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.