jeudi 5 janvier 2017

I need to create a input of four digits (all should be different and the first one should be 1)

I want to check using "pattern" attribute that the user can't enter two similar digits like: 1232, 1222, 1229 etc. After googling, I found smth like this: patter="^1(?:([2-9])(?!\1))+$", but it doesn't work for 1232 (for example) and it doesn't consider how many digits you enter.

Aucun commentaire:

Enregistrer un commentaire