From f449f2013b3bfda9924649f5e9e6358c4533dd44 Mon Sep 17 00:00:00 2001 From: Is Isilon Date: Thu, 7 Jan 2016 08:40:26 +0800 Subject: [PATCH] Added telephone field example --- wtformsparsleyjs/sample/sample.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wtformsparsleyjs/sample/sample.py b/wtformsparsleyjs/sample/sample.py index 7836144..d43e168 100644 --- a/wtformsparsleyjs/sample/sample.py +++ b/wtformsparsleyjs/sample/sample.py @@ -302,6 +302,16 @@ class ParsleyTestForm(Form): default = "crashoverhackthemainframe.c" ) + tel = wtformsparsleyjs.TelField( + label = "Enter your telephone number: ", + validators = [ + validators.Regexp('^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$', + message = "Please enter a valid telephone number e.g. +91 (123) 456-7890" + ) + ], + default = "+91 (123) 456-7890 0000000" + ) + search = wtformsparsleyjs.SearchField( label = "Enter your search term: ", validators = [