Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By kleung
#824894
Hi,

I would like to use a dropdown list for users to select a year. Instead of hard code a wide range of years, would be it possible to use Javascript to build the years in the options, e.g. from 1990 to current year, for user selection?

Many Thanks

cheers,
Karl
User avatar
By amosbatto
#824920
Add this trigger to the process:
Code: Select all
@=aYears = []; 
$year = 1990;
while ($year <= date('Y')) {
     @=aYears[] = [$year, $year];
      $year++;
}  
Set this trigger to fire before the Dynaform holding the dropdown box.

Then, in the properties of the dropdown in the Dynaform, set the datasource property to "array variable" and set the data variable property to: @@aYears
By kleung
#824927
Hi Amos,

The $aYears could be assigned with the desired values.
But the values could not be shown in the dropdown list, i.e. all the contents are blanks. I also note that the values in the labels were converted to strings.
How to fix it?

Many Thx

cheers,
Karl

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]