Welcome to the fastest growing business social platform for creatives.
You are only a few steps away from becoming a Filter Foundry member!
$(document).ready(function(){
var spl = location.href.split("/");
var typ = spl.pop();
if (!typ) typ = spl.pop();
typ = typ.split("?")[0];
if (typ.indexOf("creative") != -1)
typ = 'creative';
else if (typ.indexOf("enthusiast") != -1)
typ = 'enthusiast';
else if (typ.indexOf("employer") != -1)
typ = 'talent';
else
typ = 'creative';
$(document.body).addClass("htype_" + typ);
$('#email').focus();
var username_valid = false;
var password_valid = false;
var first_name_valid = false;
var last_name_valid = false;
var email_valid = false;
$("#register-header-button").addClass('selected');
$("#username").keyup(function () { $('.username_label').text($('#username').attr("value")); });
//$("#username").keyup(function (event) { if (event.keyCode == 8) { validate_username(); } });
$("#username").typeWatch({
callback:function(){ validate_username(); },
wait:250,
highlight:false,
captureLength:4
});
$('.username_label').text($("#username").attr("value"));
$("#username").blur(function () { validate_username(); });
$("#username").change(function () { validate_username(); });
$("#password").blur(function () { validate_password(); validate_confirm_password(); });
$("#password").keyup(function () { validate_password(); validate_confirm_password(); });
$("#password").change(function () { validate_password(); validate_confirm_password(); });
$("#confirm-password").blur(function () { validate_confirm_password(); });
$("#confirm-password").keyup(function () { validate_confirm_password(); });
$("#confirm-password").change(function () { validate_confirm_password(); });
$("#email").typeWatch({
callback:function(){ validate_email(); },
wait:250,
highlight:false,
captureLength:4
});
$('#email').keyup(function (event){
if (event.keyCode == 8) { validate_email(); }
});
$('#email').keypress(function (event){
//if (event.keyCode == 9) { $('#create_my_account').focus(); return false; }
});
$("#email").change(function () { validate_email(); });
$("#first_name").blur(function () { validate_firstname(); });
$("#first_name").keyup(function () { validate_firstname(); });
$("#first_name").change(function () { validate_firstname(); });
$("#last_name").blur(function () { validate_lastname(); });
$("#last_name").keyup(function () { validate_lastname(); });
$("#last_name").change(function () { validate_lastname(); });
$("#registration").submit(function () {
if( username_valid && password_valid && email_valid && first_name_valid && last_name_valid) {
//alert('From submitted!');
$("#regpendlink").click();
return true;
}
alert("Please verify that all fields are correctly filled out");
return false;
});
validate_username();
validate_password();
validate_confirm_password();
validate_email();
validate_firstname();
validate_lastname();
function validate_username() {
username_valid = false;
if( $("#username").attr("value") == "" ) { set_field_error($('#username'), 'UserName (For Personal PAD URL)'); return false; }
var RE_USERNAME = /^[A-Za-z\d]{4,30}$/;
if( RE_USERNAME.test($("#username").attr("value")) ) {
set_field_checking($("#username"), 'checking availability...');
$.get("/users/check-username/" + $("#username").attr("value") + "/", {}, function (is_valid) {
if( is_valid == 'true' ) { set_field_ok($("#username"), 'OK'); }
else { set_field_error($("#username"), 'NOT AVAILABLE'); username_valid = false; return false; }
});
}
else { set_field_error($("#username"), 'This name is alreaddy in use'); return false; }
username_valid = true;
return true;
}
function validate_firstname() {
first_name_valid = false;
var fn = $("#first_name").attr("value");
if( fn == "" ) { set_field_error($('#first_name'), 'First Name'); return false; }
var RE_NAME = /^([a-zA-Z\s'-]+){1,4}$/;
if(RE_NAME.test(fn)) {
set_field_good($("#first_name"), 'OK');
first_name_valid = true;
return true;
} else{
set_field_error($("#first_name"), 'INVALID FIRST NAME');
return false;
}
}
function validate_lastname() {
last_name_valid = false;
var ln = $("#last_name").attr("value");
if( ln == "" ) { set_field_error($('#last_name'), 'Last Name'); return false; }
var RE_NAME = /^([a-zA-Z'-]+)$/;
if(RE_NAME.test(ln)) {
set_field_good($("#last_name"), 'OK');
last_name_valid = true;
return true;
} else{
set_field_error($("#last_name"), 'INVALID LAST NAME');
return false;
}
}
function validate_password() {
if( $("#password").attr("value") == "" ) { set_field_error($('#password'), 'Enter Secure Password'); return false; }
//var RE_PASSWORD = /^[A-Za-z\d]{6,30}$/;
var RE_PASSWORD = /^.{6,30}$/;
if( RE_PASSWORD.test($("#password").attr("value")) ) { set_field_good($("#password"), 'GOOD'); }
else {
if ($("#password").attr("value").length < 6) {
set_field_error($("#password"), 'PASSWORD TOO SHORT'); return false;
} else {
set_field_error($("#password"), 'PASSWORD TOO LONG'); return false;
}
}
return true;
}
function validate_confirm_password() {
password_valid = false;
if( $("#confirm-password").attr("value") == "" ) { set_field_error($('#confirm-password'), 'Confirm your Password'); return false; }
if( validate_password() ) {
if( $("#confirm-password").attr("value") == $("#password").attr("value") ) { set_field_ok($("#confirm-password"), 'OK'); set_field_ok($("#password"), 'OK'); }
else { set_field_error($("#confirm-password"), "PASSWORDS DO NOT MATCH"); return false; }
} else {
set_field_error($('#confirm-password'), 'PLEASE CONFIRM PASSWORD'); return false;
}
password_valid = true;
return true;
}
function validate_email() {
email_valid = false;
if( $("#email").attr("value") == "" ) { set_field_error($('#email'), 'Valid Email Address'); return false; }
var RE_EMAIL = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if( RE_EMAIL.test($("#email").attr("value")) ) {
set_field_checking($("#email"), 'checking availability...');
$.get("/users/check-email/" + $("#email").attr("value") + "/", {}, function (is_valid) {
if( is_valid == 'true' ) { set_field_ok($("#email"), 'OK'); }
else {
set_field_error($("#email"), 'EMAIL ADDRESS IS IN USE'); return false;
}
});
}
else {
set_field_error($("#email"), 'NOT A VALID EMAIL ADDRESS'); return false;
}
email_valid = true;
return true;
}
function set_field_checking(element, message) {
element.next().removeClass();
element.next().addClass("note-checking explanation drkgray");
element.next().text(message);
}
function set_field_good(element, message) {
element.next().removeClass();
element.next().addClass("note-good explanation drkgray");
element.next().text(message);
}
function set_field_ok(element, message) {
element.next().removeClass();
element.next().addClass("note-ok explanation drkgray");
element.next().text(message);
}
function set_field_error(element, message) {
element.next().removeClass();
element.next().addClass("note-error explanation drkgray");
element.next().text(message);
}
$("#regpendlink").fancybox({
'padding':1,
'width':780,
'height':520,
'zoomSpeedIn': 300,
'zoomSpeedOut': 300,
'overlayShow': true,
'overlayColor':'#000',
'overlayOpacity':.7,
'centerOnScroll':true,
'hideOnContentClick': false,
'hideOnOverlayClick': false
});
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i
Welcome to the fastest growing business social platform for creatives.
You are only a few steps away from becoming a Filter Foundry member!