3
Hello, I wonder if there is any way to check if a String has Javascript, for example, 5 number in a random sequence to trigger an event. Therefore:
abc123de45
Must be false
abc13525de
Must be true
ab12cde453fgh76i8jk9
Must be false
Thank you!
Your sequence will be fixed or variable?
– Sorack
I take the value of a textarea field in a form and with each letter typed the variable changes: $(Document). on('input', '#content', Function(){ var content = $('#content'). val(); }
– Rodrigo Domingues
The question @Sorack raised is about the sequence: want to validate only
12345
, or worth any sequence? Type23456
,56789
,89012
(will be circular?).– Gabriel Katakura
ops, sorry. Serves any sequence of X numbers.
– Rodrigo Domingues
Should the numbers be sorted? Or a sequence of five numbers, sorted or not? Ex: ac12458cd
– BrTkCa
can be a random sequence, the important thing is to be 5 numbers in a row, I’ve edited the question.
– Rodrigo Domingues