IF ELSE not working inside the function javascript [closed]

I’m new to programming and having a hard time in this function. I’m using firebase and confuse why alert is working but the if else is not working.

this is my button and it has onclick
<button id="Insert" class="editrooms-save" onclick="register()" >Insert</button>

it confuses me because i call the ID and onclick. i know the function is working but it seems the if else is not working.

alert("TESTING")

document.getElementById("Insert").addEventListener("click", register);  

function register(){

fname = document.getElementById('fname').value;
mname = document.getElementById('mname').value;
lname = document.getElementById('lname').value;
contact = document.getElementById('contact').value;
dept = document.getElementById('dep=t').value;
email = document.getElementById('email').value;
password = document.getElementById('password').value;
 
if (validate_email(email) == false || validate_pass(pass) == false ){
 alert('Email or Password is XXXXXX')
 return
}

 
if (validate_email(contact) == false){
 alert('Contact is XXXXXX')
 return
}

if (validate_field(fname) == false || validate_field(mname) == false || validate_field(lname) == false || validate_field(dept) == false ){
 alert('Fill all fields!')
 return
}

auth.createUserWithEmailAndPassword(email, password)
 .then(function(){
     var user = auth.currentUser
     

     var user_data = {
       fname: fname,
       mname: mname,
       lname: lname,
       contact: contact,
       dept: dept,
       email: email,
       last_login: Date.now()
     }

     firebase.database().ref().child("adminaccount/" + user.uid).set(user_data)



     alert('user Created!')
 })
 .catch(function(error){
   var error_code = error.code
   var error_message = error.message

   alert(error_message)
 })

}



function validate_email(email){
 expression = /^[^@]+@w+(.w+)+w$/
 if(expression.test(email) == true) {
   return true
 } else{
   return false
 }
}

function validate_pass(password){
 if (password < 6){
   return false
 } else {
   return true
 }
}

function validate_contact(contact){
 express = /^(09|+639)d{9}$/
 if(express.test(contact) == true) {
   return true
 } else{
   return false
 }
}

function validate_field(field){
 if (field == null) {
   return false
 }

 if (field.length <=0){
   return false
 } else {
   return true
 }
}