Generate Random Alpha numeric and store in question 1 year 5 months ago #102348

 dweisser OFFLINE Gold Lime Posts: 205 Thank you received: 5 Karma: 5 I know this can be done - I just don't know how to do it. Anyone have a simple implementation for storing and displaying the results of something like this: Math.random().toString(36).slice(2) in a question's answer? As always, any assistance is appreciated. David The administrator has disabled public write access.

Generate Random Alpha numeric and store in question 1 year 5 months ago #102352

 dweisser OFFLINE Gold Lime Posts: 205 Thank you received: 5 Karma: 5 I'm still at it - no avail! I've tried many snippets like this. Anyone have thoughts on why this doesn't work? the question type is short text. The administrator has disabled public write access.

Generate Random Alpha numeric and store in question 1 year 5 months ago #102354

 dweisser OFFLINE Gold Lime Posts: 205 Thank you received: 5 Karma: 5 Still at it. This is how I spend my Saturdays. alert('test') works and everything. I'm beggin' here. The administrator has disabled public write access.

Generate Random Alpha numeric and store in question 1 year 5 months ago #102356

 dweisser OFFLINE Gold Lime Posts: 205 Thank you received: 5 Karma: 5 So, just in case it helps anyone. This took forever, and it's somewhat of a workaround, but it gave me the desired result. No javascript - all Expression Manager. I divided: {floor(rand(100000,999999))} by {time()} and rounded up to get my random number. In: {ceil(time()/floor(rand(1000,9999)))} Then I used {substr("abcdefghijklmnopqrstuvwxyz", -rand(1,26),1)} to get random alpha characters. The final implementation, in which I cleverly removed "i", "l" "o", and "O" can be seen here: {join(ceil(time()/floor(rand(1000,9999))), substr("abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", -rand(1,48),1), substr("abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", -rand(1,48),1))} Placing this in the source of your survey item will yield something like this: 231387Cp Enjoy. Nebraska David The administrator has disabled public write access. The following user(s) said Thank You: Ben_V

Generate Random Alpha numeric and store in question 1 year 5 months ago #102363

 Ben_V NOW ONLINE Platinum Lime Posts: 1357 Thank you received: 323 Karma: 89 thanks for sharing.. =>related previous thread: Generate Unique PIN for user Benoît goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche) goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar) goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de... Last Edit: 1 year 5 months ago by Ben_V. The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.110 seconds