Newer
Older
dmpopidor / lib / assets / javascripts / roadmap.js
@briley briley on 9 Jun 2017 791 bytes resolved cherry-pick conflicts
$(document).ready(function(){
  
  $('input[type="email"]').on('change', function(){
    if(!validateEmail($(this).val().trim())){
      $("#" + $(this).attr('id') + "_tip").attr('role', 'tooltip');
    }else{
      $("#" + $(this).attr('id') + "_tip").attr('role', '');
    }
  });
  
  $('input[name*="password"]').on('change', function(){
    if(!validatePassword($(this).val().trim())){
      $("#" + $(this).attr('id') + "_tip").attr('role', 'tooltip');
    }else{
      $("#" + $(this).attr('id') + "_tip").attr('role', '');
    }
  });
});


// ---------------------------------------------------------------------------
function validatePassword(sPassword) {
  if (sPassword.trim().length >= 8 && sPassword.trim().length <= 128){
    return true;
  }
  else {
    return false;
  }
}