Accessing return value from an outside function in jquery plugin
===

    function ($) {
        $.fn.required = function (options) {
            var defaults = {
                controlid: 'none',
                custommessage: 'red',
                itemFunction: function () { }
    
            };
 
i want to get the return value of ComparePassword() function in jquery plugin 

     $(document).ready(function (e) {            
                $('.required').required({
                    controlid: '#testcust',
                    custommessage: 'Hi Hi Caught',             
                    itemFunction: function () { ComparePassword(); } // Returns a Jquery Result value true or false(if ok then true)
                   
                });
            });        
            function ComparePassword() {
                if ($("#schedulecode").val() != $("#hsnCode").val()) {                   
                    return false;                  
                }
                else {                   
                    return true;
                }
    
            }