lucasassad Posted May 4, 2015 at 02:36 PM Report Share #582438 Posted May 4, 2015 at 02:36 PM Tipo, mais de 6 digitos, tantos numeros... caracteres tipo @@... Obrigado Link to comment Share on other sites More sharing options...
bioshock Posted May 4, 2015 at 03:56 PM Report Share #582444 Posted May 4, 2015 at 03:56 PM Estamos a falar de HTML5? Podes colocar um pattern mas tens de validar na mesma via linguagem servidor. Link to comment Share on other sites More sharing options...
help Posted May 4, 2015 at 05:29 PM Report Share #582452 Posted May 4, 2015 at 05:29 PM (edited) Se quiser só letras e números para um input de senha, pode fazer assim no HTML <form> <input type="text" pattern="[a-zA-Z0-9]{5,6}" name="" value="" placeholder="5 à 6 caracteres" required /> <input type="submit"> </form> E assim no PHP <?php $string = $_POST['input_tal']; if(!preg_match("/^([a-zA-Z0-9]+)$/i",$string) || strlen($string) < 5 || strlen($string) > 6) { echo "texto incorreto"; } else { echo "texto correto"; } ?> Edited May 4, 2015 at 06:04 PM by apocsantos geshi Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now