I am creating a form validation plugin for jQuery and would like it to call a function once the form has been successfully validated. The plugin will have a default callback function, but I would like to modify this through the options parameter. Unfortunately what i have (below) does not work. Any ideas?
(function($){
$.fn.extend({
validify : function(options) {
var defaults = {
callback: "callbackFunc",
};
var options = $.extend(defaults,options);
return this.each(function(){
//validation code here
//if valid call the function
if(errors==0){
options.callback;
}
function callBackFunc(){
// the default callback function
}
...