This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateCaptcha(){ | |
var valueGr = document.getElementById("g-recaptcha-response").value; | |
if(valueGr == null){ | |
return false; | |
}else{ | |
return true; | |
} | |
} | |
$(document).ready(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$language = \Drupal::languageManager()->getCurrentLanguage()->getId(); | |
$user = \Drupal\user\Entity\User::create(); | |
$user->setPassword($form_state->getValue('pass')); | |
$user->enforceIsNew(); | |
$user->setEmail($form_state->getValue('mail')); | |
$user->setUsername($form_state->getValue('name'));//This username must be unique and accept only a-Z,0-9, - _ @ . | |
$user->set("init", 'mail'); | |
$user->set("langcode", $language); | |
$user->set("preferred_langcode", $language); | |
$user->set("preferred_admin_langcode", $language); |