Skip to content

Instantly share code, notes, and snippets.

@spacecowb0y
Created August 6, 2011 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacecowb0y/1128909 to your computer and use it in GitHub Desktop.
Save spacecowb0y/1128909 to your computer and use it in GitHub Desktop.
Find provider
// medio cabeza, es la primera version, lo escribí de corrido eh, sin ningún error.
$(function(){
function find_provider(str) {
str = str.split("@");
str = str[1];
str = str.split(".");
str = str[0];
if ( (str != "gmail") || (str != "yahoo") || (str != "hotmail") ) {
$('form small span').removeClass('current');
}
switch (str)
{
case "gmail":
$('form small span').removeClass('current');
$('#'+str).addClass('current');
break;
case "yahoo":
$('form small span').removeClass('current');
$('#'+str).addClass('current');
break;
case "hotmail":
$('form small span').removeClass('current');
$('#'+str).addClass('current');
break;
}
console.log(str);
}
$('#user_email').keyup(function(e) {
find_provider($(this).val());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment