Skip to content

Commit

Permalink
Item9999: only validate phonenumbers when the surrounding form has go…
Browse files Browse the repository at this point in the history
…t a validator

git-svn-id: http://svn.foswiki.org/trunk/MoreFormfieldsContrib@17478 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Apr 3, 2014
1 parent 361daa5 commit dbed1c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pub/System/MoreFormfieldsContrib/phonenumber.uncompressed.js
Expand Up @@ -8,9 +8,12 @@
}, 'Please enter a valid phone number (Intl format accepted + ext: or x:)');

$("input.foswikiPhoneNumber").livequery(function() {
$(this).rules("add", {
phone: true
});
var form = this.form;
if ($.data(form, "validator")) {
$(this).rules("add", {
phone: true
});
}
});

})(jQuery);

0 comments on commit dbed1c8

Please sign in to comment.