Function in current object cannot be called. Why?
<p>I have a function called <code>Validation</code> which contains three functions. Now when I want to call one other function from one function inside <code>Validation</code> i.e. on line 13. Then I get this error </p>

<pre><code>Uncaught TypeError: Object [object Object] has no method 'validateAddress' 
</code></pre>

<p>Here is my code</p>

<pre><code>var Validation = function () {
var inputs, field, errors = [], self = this,

emptyFieldsValidation = function () {
    $('#form input').each(function (i, el) {
        inputs = $(this);
        if ( inputs.val() == '' ) {
            inputs.css('border', '1px solid red');
            return errors.push('emptyFields');
        } else {
            inputs.css('border', '1px solid #ccc');
            if (inputs.hasClass('from')) {
                if (!self.validateAddress(inputs.val()))
                    errors.push('invalidFromAddress');
            }
            if (inputs.hasClass('to')) {
                if (!self.validateAddress(inputs.val()))
                    errors.push('invalidToAddress');
            }
            if (inputs.hasClass('time')) {
                if (!self.validateForNumber(inputs.val()))
                    errors.push('invalidTime');
            }
        }
    });
    return !!errors.length;
},

validateAddress = function (val) {
    var streetregex = /^[\w+\s]+\d+,\s*[\s\w]+$/;
    if (streetregex.test(val)) return true;
    else return false;
},

validateForNumber = function (val) {
    if (!isNaN(val)) return true;
    else return false;
};

return {
    emptyFieldsValidation: emptyFieldsValidation
};
}
</code></pre>
