Jump to content

Form Field: PHONE - way to have a numeric entry keypad?

Recommended Posts

Is there a way to have the Squarespace's form have a numeric entry keypad (#0-9) when entering numbers on a mobile device? Instead of having the full keyboard, it would swap into a numeric entry keypad when clicking onto the phone number line. I've tried using the "Numbers" field too, and that doesn't work.

Is there a custom html code that can be integrated into Squarespace to allow this?

Link to comment
  • 1 year later...
  • Replies 1
  • Views 1.5k
  • Created
  • Last Reply

Hey

This depends a bit what type of field you are using. For the usual phone number and number field, add this into the footer Code Injection


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
 $('.three-digits .field-element').attr("type", "number");
 $('.number .field-element').attr("type", "number");
</script>


Hope that helps someone!

Link to comment

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
×
×
  • 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.