From 8cac2e520ce596c46333b972fc41d7ca0d325e9f Mon Sep 17 00:00:00 2001 From: emirpprime Date: Fri, 23 Sep 2011 12:34:25 +0100 Subject: [PATCH] Added support for most useful and widely supported HTML5 Input types New HTML5 Input types are being used now - this allows them to be used by telling the script to treat them as Text (this is what browsers that don't support the new types do anyway). Could later be integrated more fully with default validation types based on them. Included: Email, URL, Tel, Number, Range. --- src/livevalidation_prototype.js | 4 +++- src/livevalidation_standalone.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/livevalidation_prototype.js b/src/livevalidation_prototype.js index de8faa5..0621f4e 100644 --- a/src/livevalidation_prototype.js +++ b/src/livevalidation_prototype.js @@ -237,7 +237,9 @@ LiveValidation.prototype = { return LiveValidation.TEXTAREA; case (nn == 'INPUT' && nt == 'TEXT'): return LiveValidation.TEXT; - case (nn == 'INPUT' && nt == 'PASSWORD'): + case (nn == 'INPUT' && (nt == 'EMAIL' || nt == 'URL' || nt == 'TEL' || nt == 'NUMBER' || nt == 'RANGE')): + return LiveValidation.TEXT; + case (nn == 'INPUT' && nt == 'PASSWORD'): return LiveValidation.PASSWORD; case (nn == 'INPUT' && nt == 'CHECKBOX'): return LiveValidation.CHECKBOX; diff --git a/src/livevalidation_standalone.js b/src/livevalidation_standalone.js index 7dae40d..da37d2d 100644 --- a/src/livevalidation_standalone.js +++ b/src/livevalidation_standalone.js @@ -240,6 +240,8 @@ LiveValidation.prototype = { return LiveValidation.TEXTAREA; case (nn == 'INPUT' && nt == 'TEXT'): return LiveValidation.TEXT; + case (nn == 'INPUT' && (nt == 'EMAIL' || nt == 'URL' || nt == 'TEL' || nt == 'NUMBER' || nt == 'RANGE')): + return LiveValidation.TEXT; case (nn == 'INPUT' && nt == 'PASSWORD'): return LiveValidation.PASSWORD; case (nn == 'INPUT' && nt == 'CHECKBOX'):