2
How to get the last name and initials in javascript
ex: Manoel de Souza Oliveira.
Return: manoelso
I have this code that takes the first name:
function dicalogin() {       
    var nome = form.no_nome.value;
    var espaco = " ";
    var i = 0;
    var chegou = 0;
    var login ='';
    for (i = 0; i < nome.length; i++) {
        if (nome.charAt(i) == espaco) {
            chegou++;
            if (chegou == 1) {
                //TRANSFORMANDO CARACTERES QUE ESTA EM X EM MINUSCULO
                nome = nome.toLowerCase();
                form.no_login.value = nome.substr(0, i);
                login += nome.substr(0, i);
            }
        }
        if (chegou == 0) {
            nome = nome.toLowerCase();
            form.no_login.value = nome;
        }
    }
}
						
lacked to remove "dos" "das" also xD +1
– Rod
@Rod well remembered I will update the code
+1:)– Felipe Assunção