Here is my jquery code as the previous question https://stackoverflow.com/a/464632/
$('#productId').validate({ rules: { product: { required: true, term: {regex: /^$|\s/} } }, messages: { product: { required: "A text is much", term: "Please avoid spaces" }, }, showErrors: function (errorMap, errorList) { $.each(this.successList, function (index, value) { $('#'+value.id+'').popover('destroy'); }); $.each(errorList, function (index, value) { $('#'+value.element.id+'').attr('data-content',value.message, 'title', 'Oops!').popover({ placement: 'top', trigger: 'manual', delay: { show: 500, hide: 5000 } }).popover('show'); }); } });
What I'm trying to do is show a popover if there is a space in the entered term. But every time he gives me an error
Uncaught TypeError: Cannot call method 'call' of undefined
I know that something is wrong with the regex part. Because I tried the same code with minLength, and it worked well. What am I doing wrong?
PS I am using twitter bootstrap for popover.
UPDATE: More on the error
Uncaught TypeError: Cannot call method 'call' of undefined ----------jquery.validate.js:504 $.extend.check ---------- jquery.validate.js:504 $.extend.element ---------- jquery.validate.js:357 $.extend.defaults.onfocusout ---------- jquery.validate.js:231 delegate ---------- jquery.validate.js:317 (anonymous function) ---------- jquery.validate.js:1184 jQuery.event.dispatch ---------- jquery.js:3075 elemData.handle ---------- jquery.js:2751 jQuery.event.trigger ---------- jquery.js:2987 jQuery.event.simulate ---------- jquery.js:3302 handler
jquery jquery-validate twitter-bootstrap
psharma Apr 18 '13 at 15:40 2013-04-18 15:40
source share