Permalink
Browse files

added quotes for element names in validator, allows names with square…

… brackets, etc
  • Loading branch information...
zeroasterisk committed Nov 29, 2011
1 parent 46b8662 commit de40eedba2aaba2c0fa0328788b02376e15e10d5
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/validator/validator.js
@@ -261,7 +261,7 @@
v.fn(":radio", "Please select an option.", function(el) {
var checked = false;
- var els = $("[name=" + el.attr("name") + "]").each(function(i, el) {
+ var els = $("[name='" + el.attr("name") + "']").each(function(i, el) {
if ($(el).is(":checked")) {
checked = true;
}
@@ -578,7 +578,7 @@
// get radio groups by name
inputs.filter(":radio[required]").bind("change.V", function(e) {
- var els = $("[name=" + $(e.srcElement).attr("name") + "]");
+ var els = $("[name='" + $(e.srcElement).attr("name") + "']");
if ((els != null) && (els.length != 0)) {
self.checkValidity(els, e);
}
@@ -621,4 +621,4 @@
};
-})(jQuery);
+})(jQuery);

0 comments on commit de40eed

Please sign in to comment.