JS error when using :blank or :filled in required rule in a form with li elements
November 2, 2009 - 2:30am — jeff_themovie
| Project: | Validation |
| Version: | 1.5.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
JS error "(E || "").replace is not a function" occurs when:
- within the form element are one or more li elements
- there is at least one required rule that uses the :blank or :filled selector
- using jQuery 1.3
What ends up happening is that the li elements are checked against the :blank and :filled selectors (I'm guessing due to Sizzle's bottom-up matching). The li elements have a deprecated "value" attribute, but this is a number not a string, which causes $.trim() to throw an error.
Please see the attached test case.
| Attachment | Size |
|---|---|
| Test case | 846 bytes |

Comments
#1
I'm now converting whatever is passed to $.trim to a string. Fixes this issue.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
I agree with the statement that China and the United States can together drive a global clean energy economy that may define the 21st century! Cool facts for writing a paper in college or university for scientific classes! Online Nutritional Health Science degree AND Web Development degree AND public administration school AND Online school AND sociology degree