Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

JS error when calling validation functions

$
0
0
Could anybody help me calling a validation function?
This is what I'm doing - adding can.jquery.js and can.map.validations.js
and then creating such a small function as general as in the most simple can.js example:

var mymap = can.Map.extend({
    init: function () {
      this.validatePresenceOf('myfield'); // this line reports an error
    }
});

when loading page with this script, I get an error in browser:
"Uncaught TypeError: undefined is not a function"

Actually any this.validate* function does not work

What I'm doing wrong? I spent couple of hours to figure out but no success so far

Viewing all articles
Browse latest Browse all 3491

Trending Articles