[otrs-cvs] Fred/var/httpd/htdocs/js FredHTMLCheck.js,1.11,1.12
"CVS commits notifications of OTRS.org" <[email protected]> Thu, 14 Mar 2013 10:18:10 +0000
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/Fred/var/httpd/htdocs/js
In directory lancelot:/tmp/cvs-serv2191/var/httpd/htdocs/js
Modified Files:
FredHTMLCheck.js
Log Message:
Fixed error when working with special characters in element IDs.
Author: mg
Index: FredHTMLCheck.js
===================================================================
RCS file: /home/cvs/Fred/var/httpd/htdocs/js/FredHTMLCheck.js,v
retrieving revision 1.11
retrieving revision 1.12
diff -2 -u -d -r1.11 -r1.12
--- FredHTMLCheck.js 12 Mar 2013 14:18:42 -0000 1.11
+++ FredHTMLCheck.js 14 Mar 2013 10:18:05 -0000 1.12
@@ -20,4 +20,8 @@
}
+ function escapeSelector (Selector) {
+ return Selector.replace(/(:|\.|\[|\])/g,'\\$1');
+ }
+
function outputError($Element, ErrorType, ErrorDescription, Hint){
var $Container,
@@ -62,5 +66,5 @@
// first look for labels which refer to this element by id
if ($this.attr('id') && $this.attr('id').length) {
- $Label = $('label[for=' + $this.attr('id') + ']');
+ $Label = $('label[for=' + escapeSelector($this.attr('id')) + ']');
}
// then look for labels which surround the current element
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log