Oi pessoal.
Estou fazendo esta validação de senha:
functioncheckPassword(nmSenha){
if((nmSenha.value.length<6)||(nmSenha.value.length>8)){
alert("A senha deve ter entre 6 e 8 caracteres");}
elseif(!((nmSenha.search(/(a-z)+/))&&(nmSenha.search(/(A-Z)+/))&&(nmSenha.value.search(/(0-9)+/)))){
alert("A senha deve conter pelo menos 1 letra maiúscula,1 minúscula e 1 número");}
}
The page in Listing 34-4 lets you practice with the string.replace() and string.search() methods and regular expressions in a friendly environment. The source text is a five-line excerpt from Hamlet. You can enter the regular expression to search for, and the replacement text as well. Note that the script completes the job of creating the regular expression object, so that you can focus on the other special characters used to define the matching string. All replacement activities act globally, because the g parameter is automatically appended to any expression you
enter.
Default values in the fields replace the contraction 'tis with “it is” after you click the “Execute replace( )” button. Notice that the backslash character in front of the apostrophe of 'tis (in the string assembled in mainString) makes the apostophe a non-word boundary, and thus allows the \B’t regular expression to find a match there. As described in the section on the string.search() method, the button connected to that method returns the offset character number of the matching string (or -1 if no match occurs).
You could modify the listing so that it actually replaces text in the HTML paragraph for IE4+ and NN6. The steps include wrapping the paragraph in its own element (for example, a SPAN), and invoking the replace() method on the innerHTML of that element. Assign the results to the innerHTML property of that element to complete the job.
juliano ia ser melhor se voce postasse o link e nao copiasse a pagina de help em ingles ainda por cima no forum.
J
julianostr
fmeyer:
juliano ia ser melhor se voce postasse o link e nao copiasse a pagina de help em ingles ainda por cima no forum.
Isso não veio de uma página da net, isso eu tirei de um PDF do livro Bíblia do JavaScript.
E agora eu vou ser criticado por postar texto em inglês? Ele não tem obrigação de saber inglês (quando deveria, pelo menos pra leitura), mas o exemplo (HTML) está ali pra auxiliá-lo.
O que eu posso ter errado é não ter colocado um cabeçalho de introdução do meu post explicando de onde vem pra onde vai.
C
Chale
Olá Juliano
Obrigado pelo texto explicativo,foi muito útil.
Resolvi o problema.
Um abraço!!!
Fmeyer,valeu pela dica do Firefox!!!
…e não briguem gente,paz e amor!