- Posts: 6
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); const longitud = 16; const caracteres = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%&"; let cadenaAleatoria = ""; for (let i = 0; i < longitud; i++) { const indiceAleatorio = Math.floor(Math.random() * caracteres.length); cadenaAleatoria += caracteres.charAt(indiceAleatorio); } $('input[type=text]', thisQuestion).val(cadenaAleatoria); }); </script>