Core: Escape id/name before using it as a selector in errorsFor

Fixes #1275
This commit is contained in:
Jörn Zaefferer
2014-09-23 13:27:51 +02:00
parent a8765ff614
commit 20f3e9fac9
3 changed files with 19 additions and 1 deletions

View File

@@ -331,3 +331,16 @@ test( "test pre-assigned non-error aria-describedby", function( assert ) {
strictEqual( "This is where you enter your data", $("#testForm17text-description").text() );
strictEqual( "", $("#testForm17text-error").text(), "Error label is empty for valid field" );
});
test( "test id/name containing brackets", function( assert ) {
var form = $( "#testForm18" ),
field = $( "#testForm18\\[text\\]" );
form.validate({
errorElement: "span"
});
form.valid();
field.valid();
assert.hasError( field, "required" );
});