text: function formhash(form, password) {
      console.log("Hashing form");
      // Create a new element input, this will be our hashed password field.
      var p = document.createElement("input");
  
      // NOW, add the new element to our form.
      form.appendChild(p);
  
      p.name = "p";
      p.type = "hidden"
      //p.value = hex_sha512(password.value);
      p.value= password.value;
  
      // Make sure the plaintext password doesn't get sent.
      password.value = "";
      // Finally submit the form.
      form.submit();
  }
  function cekajadeh(form,div){
      // e.preventDefault();
      var tp = document.createElement("input");
  
      // NOW, add the new element to our form.
      form.appendChild(tp);
  
      alert('tes');
      tp.name = "attTipe";
      tp.type = "hidden";
      //p.value = hex_sha512(password.value);
      tp.value= div.value;
      console.log('masuk sini');
      // Make sure the plaintext password doesn't get sent.
      //password.value = "";
      // Finally submit the form.
      //form.submit();
  }
  function regformhash(form, username, password, confpassword) {
      // Check the username
   
      re = /^\w+$/; 
      if(!re.test(form.username.value)) { 
          alert("Username must contain only letters, numbers and underscores. Please try again"); 
          form.username.focus();
          return false; 
      }
   
      // Check that the password is sufficiently long (min 6 chars)
      // The check is duplicated below, but this is included to give more
      // specific guidance to the user
      if (password.value.length < 6) {
          alert('Passwords must be at least 6 characters long.  Please try again');
          form.password.focus();
          return true;
      }
   
      // At least one number, one lowercase and one uppercase letter 
      // At least six characters 
   
      var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/; 
      if (!re.test(password.value)) {
          alert('Passwords must contain at least one number, one lowercase and one uppercase letter.  Please try again');
          form.password.focus();
          return false;
      }
   
      // Check password and confirmation are the same
      if (password.value != confpassword.value) {
          alert('Your password and confirmation do not match. Please try again');
          form.password.focus();
          return false;
      }
   
      // Create a new element input, this will be our hashed password field. 
      var p = document.createElement("input");
   
      // Add the new element to our form. 
      form.appendChild(p);
      p.name = "p";
      p.type = "hidden";
      p.value = password.value;
   
      // Make sure the plaintext password doesn't get sent. 
      password.value = "";
      conf.value = "";
   
      // Finally submit the form. 
      //form.submit();
  
      return true;
  }
  
  function validate(form, FG_id, FG_name, FG_address, FG_phone){
    if (FG_id.value == ''         || 
            FG_name.value == ''     || 
            FG_address.value == ''  || 
            FG_phone.value == '') 
      {
   
          alert('You must provide all the requested details. Please try again');
          return false;
      }
    $('#FAB_flo').show;
    return true;
  }