Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Generate Table# and Seat# Image

Avatar

Level 3

I need your help to generate a random table# and seat# each time I click the button.

Since each table Must seat 10 people, when the manager enters a number into the Nbr.of Tables field such as 10, it means we're going to have 100 seats. Please try to help. 

function(){return A.apply(null,[this].concat($A(arguments)))}

3 Replies

Avatar

Former Community Member

Not sure what you are asking ......if I enter in 10 Tables you want the form to generate a table number from 1-10 and then a seat

number at that table?

Avatar

Level 3

Yes, if you enter 8 in the table field and the table seats 10 then I need to generate a table number and the the seat number. in this case will have 8 tables and 80 seats.

Avatar

Former Community Member

What if you generateed a series of random numbers from 1 - 80 and put them in an array. Then as each person came to register you woudl grab the random number off of thetop of the array and assign them the table and seat accordinngly.

paul