Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range

Quote Reply
Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range In reply to
Hi Vishal,

I am not sure what exactly is your task but given I understand you right you cold add a global e.g. rand_31 with:

Code:
sub {
my @array = ( 1 .. 31 );
use List::Util qw(shuffle);
@array = shuffle(@array);
return @array;
}

and in the templates call the sub and loop through it.
Not 100% sure if you can return an array to the templats or if you have to

Code:
sub {
my @array = ( 1 .. 31 );
use List::Util qw(shuffle);
@array = shuffle(@array);
return \@array;
}

Regards

Niko

Last edited by:

el noe: Apr 3, 2020, 12:34 AM
Subject Author Views Date
Thread; hot thread How to do this: Add multiple unique randomized hidden fields from desired range VishalT 16390 Mar 31, 2020, 9:59 PM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Andy 16247 Apr 1, 2020, 1:12 AM
Thread; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16238 Apr 1, 2020, 1:33 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
el noe 16223 Apr 2, 2020, 3:38 PM
Thread; hot thread Re: [el noe] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16206 Apr 3, 2020, 12:00 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
el noe 16203 Apr 3, 2020, 12:31 AM
Thread; hot thread Re: [el noe] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16207 Apr 3, 2020, 1:01 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
el noe 16192 Apr 3, 2020, 1:16 AM
Thread; hot thread Re: [el noe] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16200 Apr 3, 2020, 1:26 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Andy 16187 Apr 3, 2020, 1:35 AM
Thread; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16192 Apr 3, 2020, 1:40 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Andy 16188 Apr 3, 2020, 1:41 AM
Thread; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16208 Apr 3, 2020, 1:45 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Andy 16179 Apr 3, 2020, 1:53 AM
Thread; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16186 Apr 3, 2020, 2:04 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Andy 16169 Apr 3, 2020, 2:07 AM
Post; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16148 Apr 3, 2020, 2:22 AM
Thread; hot thread Re: [Andy] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16165 Apr 3, 2020, 10:04 AM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
el noe 16119 Apr 3, 2020, 12:37 PM
Thread; hot thread Re: [el noe] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 16153 Apr 3, 2020, 12:56 PM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Robert 14166 Sep 1, 2020, 10:29 AM
Thread; hot thread Re: [Robert] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 14162 Sep 1, 2020, 5:31 PM
Thread; hot thread Re: [VishalT] How to do this: Add multiple unique randomized hidden fields from desired range
Robert 14139 Sep 2, 2020, 6:41 AM
Post; hot thread Re: [Robert] How to do this: Add multiple unique randomized hidden fields from desired range
VishalT 14122 Sep 2, 2020, 10:22 AM