Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

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

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

User avatar
By amosbatto
Add this trigger to the process:
Code: Select all
@=aYears = []; 
$year = 1990;
while ($year <= date('Y')) {
     @=aYears[] = [$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
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


[quote=ziadeh post_id=823031 time=1550759948 user_[…]

I have to support reports in processmaker 3.4. A s[…]

The link no longer exists because PM only supports[…]

Hi, we tried the config file but still the same pr[…]