Stack Exchange
Always returning false | Javascript | objects
I am working on a project in which I am referencing a variable in one object/function from another. I always returns false however. I am not sure if I am calling it correctly.
Here is the validation function:
app.validation = function(){
    'use strict';
    var validCheck = true;

    if((app.process.user.length < 3) || (app.process.user.length > 50)){
        validCheck = false;
        window.alert("The username is not acceptable. Example: username");
    };
    if((app.process.name.length < 3) || (app.process.name.length > 50) || (!app.process.name.indexOf(" ") === -1)){
        validCheck = false;
        window.alert("The name is not acceptable. Example: John Smith");
    };
    if((app.process.email.length < 3) || (app.process.email.length > 100) || (!app.process.email.indexOf("@") === -1)){
        validCheck = false;
        window.alert("The email is not acceptable. Example: john@mail.co.uk");
    };
    if((app.process.passlength < 6) || (app.process.pass.length > 20)){
        validCheck = false;
        window.alert("The password is not acceptable. Example: password");
    };
    if((app.process.age.length < 1) || (app.process.age.length > 2)){
        validCheck = false;
        window.alert("The age is not acceptable. Example: 22");
    };
    return validCheck;
};

This is where the variable is stored:
app.process = function(){
    'use strict';
    var user = document.getElementById("user").value;
    var name = document.getElementById("name").value;
    var email = document.getElementById("email").value;
    var pass = document.getElementById("pass").value;
    var age = document.getElementById("age").value;

    var test = app.validation();
    console.log(test);
    if(!test){
        window.alert("Try Again.");
    }else{
        app.reset();
        app.members[app.members.length] = new app.Member(user, name, email, pass, age);
        app.printMembers();
    };
};

There is much more to this code however is to large to post here. these are the two functions causing the problem.

You can't access app.process variables because they are private to the function. You need pass those values to app.validation somehow to validate them.
The way I would do it is
var data = {
    user: document.getElementById("user").value,
    name: document.getElementById("name").value,
    email: document.getElementById("email").value,
    pass: document.getElementById("pass").value,
    age: document.getElementById("age").value
};

var test = app.validation(data);

And in validation
app.validation = function(data) { ...

And replace every app.process.field for data.field.

Would data be defined within the process method or globally?

Within, always within :) globals variables are from hell.
