From 909b9ddbf22a10dcd95993ab6c616274e2a53c6c Mon Sep 17 00:00:00 2001 From: Joel Sutherland Date: Thu, 10 May 2012 14:16:42 -0400 Subject: [PATCH] add optional attribute --- jquery.formvalidator.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jquery.formvalidator.js b/jquery.formvalidator.js index c87fea1..aad2ddf 100755 --- a/jquery.formvalidator.js +++ b/jquery.formvalidator.js @@ -237,6 +237,11 @@ // Validate element values // $form.find('input,textarea,select').each(function() { + + if ($(this).attr("data-optional") == 'true' && $(this).val() == '') { + return true; + } + if (!ignoreInput($(this).attr('name'), $(this).attr('type'))) { // memorize border color