Simple login form with vanilla HTML markup This is just a simple login form with a very vanilla HTML markup, but  I just wanted to get some professional feedback. I know about jslint and try to adhere to there principals where possible.

&lt;script&gt;
//event listeners
$('#sign_in_button').on('click', sign_in);
$('#create_new_account').on('click', create);
$('#create_signup_form').on('click', modal);

function modal() {
    $('#error_box2').text('').hide();
}

function login_success() {
    linkLocation = 'home.html';
    $("body").fadeOut(3000, redirect_page);    
}

function redirect_page() {
    window.location = linkLocation;
}

function login_error() {
    var msg = 'Error logging in';  
    error(msg);
}


function get_form_input(id,validator) {
    var check ='',
        type =$(id).attr('type');

    if(type != 'checkbox' ) {
        check = $(id).val();
    } else if (type == 'checkbox') {
        check = $(id).attr('checked');
    }

    if(validator(check)){
        return check;
    } else {
        return false;
    }
    return false;
}



///validation functions
function validate_username(id) {
    var username_regex = /^[A-Za-z](?=[A-Za-z0-9_.]{3,20}$)[a-zA-Z0-9_]*\.?[a-zA-Z0-9_]*$/;
    var msg;
    if (!username_regex.test(id)) {
        if ((id.length) &gt; 21){
            msg = "under 20 characters.";
        } else if((id.length) &lt; 4) {
            msg = " more than 4 characters.";
        }else {
            msg = "You can use 4-20 characters, including underscores and one dot.";
        }
        return error(msg);
    } 
    return username_regex.test(id);
}

function validate_password(pass) {
    var msg;
    var password_regex = /^.{8,20}$/;

    if (password_regex.test(pass)) {
        return true;
    } else if (pass.length &lt;8) {
        msg = "Passwords should be 8 characters or more.";
        return error(msg);
    } else if (pass.length &gt;21) {
        msg= "twenty character max";
        return error(msg);
    }
    else if (!password_regex.test(password)) {
        msg= "Passwords can be  8-20 characters";
        return error(msg);
    }    
}


function validate_email(email) {
      var email_regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      var msg;
      if (!email_regex.test(email)) {
          msg = "Not a valid email.";
          return error(msg);
      }
     return email;
}


function error(msg) {
    $('#error_box1').slideDown();
    $('#error_box1').text(msg);

    return false;
}

function create_success() {
    login_success();
}

function create_error() {
    var msg = 'Error logging in';  
    error(msg);
}


function sign_in() {
    var send = {
        'password' : get_form_input('#password', validate_password),
        'username' : get_form_input('#username', validate_username),
    };
    var url = "http://";

    if (send.username &amp;&amp; send.password) {
    console.log(send); 
        $.when($.post(url,send)).then(login_success, login_error);
    } else {
        return;
    }

}

function create() {
    var send = {
        'password' : get_form_input('#new_password', validate_password),
        'username' : get_form_input('#new_username', validate_username),
        'email'    : get_form_input('#new_email', validate_email)
    };


    var url = "http://";

    if (send.username &amp;&amp; send.password &amp;&amp; send.email) {
        console.log(send); 
        $.when($.post(url,send)).then(create_success, create_error);
    } else {
        //return error('Error logging in. Try again soon.');
    }
}


&lt;/script&gt;



What is the non-quick fix for the name space issue? 
Why couldn't a heavy, more complicated application not function effectively with procedural code?
It's in the HTML (script tag). Link it. Keep 'em separated whenever possible.
Not a big deal but when declaring vars you can do them with one var statement, e.g. var a = 0, b = 3;
Add 'use strict;' to look super cool (but I've seen at least one thing that will break)
Fix stuff like linkLocation = 'home.html'; (no var statement - would be global - illegal in strict mode)
window is global in browsers. window.location can just be called as location
If this is to be seen by interviewers, be consistent with your style. For instance, you  mix ' and " for strings. Most prefer ' to differentiate from HTML attribute quotes which are typically double. Mixing both looks like it's not all your code or you're a little sloppy.
When it's just a JavaScript object and not JSON, it doesn't need quotes on the property names. e.g. send = { 'password':...
If it's an interview situation, don't pretend any of the regEx is yours unless you can explain it.
You're pooping all over the global namespace - quick fix would be:

(function(){

//wrap your code here

})()


Don't know what's wrong with code formatting but that puts your functions in scope with anonymous function that automatically fires so it should keep your stuff from being overwritten or overwriting other stuff in the global namespace.

Otherwise it looks like good, clean, straightforward, procedural code. Nothing wrong with that when it's all that's called for. If this were a heavy, complicated, application, I'd be wondering where the objects were at.