I\'m trying to figure out how I can turn this:
$(\'#username\').blur(function(){
$.post(\'register/isUsernameAvailable\',
{\"username\":$(\'#
Well I dunno bout your plugin concept specifically but I gather you want it to check to see with that plugin if the username is greater than 6 or less than 12. Which from your core example with jQuery without the plugin it would be as simple as adding one little if-else to the concept.
$('#username').blur(function(){
if($('#username').val().length < 6 || $('#username').val().length > 12)
{
alert('Username must be between 6 and 12 characters');
}
else
{
$.post('register/isUsernameAvailable',
{"username":$('#username').val()},
function(data){
if(data.username == "found"){
alert('username already in use');
}
}, 'json');
}
});