Streaming live at 10am (PST)

Form phone input validation


How do I add validation for a phone number input in form field?
I see that there is validation for Email can not find for Phone Number.


Hi, this can be done, but not natively in webflow via the UI (at the moment). What you can do though, is to create an event listener in jquery, that can listen to the “blur” event, so that when a user mouses out of the phone field, a javascript function is called that checks the content in the form field for phone and validates it, before the form is submitted. If you need some help, you can send me a pm…

example code pasted in “before body” section of site settings --> Custom Code:

$( "#phonefield" ).blur(function() {

If you want to have more information and look it up yourself, you can find it at:

And for the phone number validation, To valid a phone number like:


use the following code: in the function that you call on the blur event:

function phonenumber(inputtxt) {  
var phoneno = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;  
      return true;  
        alert("Not a valid phone number, please correct");  
        return false;  

You can paste the function also into the “before body” section of site settings --> custom code.