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.
User avatar
By rymrbh

In a dynaform, I want to fill dynamically a dropdown menu.

I have an initial dropdown menu with a list of hosts, when I select one host some javascript is executed to get from an api a list of IP addresses. And I want to fill my second dropdown menu with those IP addresses. They are in a string variable returned by a php code .

I tried to do it using this doc ... pt_Methods but it's not working.

Thanks for your help.
User avatar
By amosbatto
You can use mergeOptions() for this in JavaScript.
See: viewtopic.php?f=47&t=710111
Your JavaScript code in the DynaForm will be something like this:
Code: Select all
$("#dropdown1").setOnchange( function(newVal, oldVal) {
    var aOptions = $("#dropdown2").getInfo().options;
    aOptions.push( {"value": newVal,  "label": newVal} );
To set the list of options in the first dropdown, set it datasource property to "array variable" then set the array variable property to @=myArray. Then, create a Trigger executed before the DynaForm to set the list of options in @=myArray:
Code: Select all
@=myArray = array(
    array("", ""),
    array("", ""),
    array("", "")

Maybe try increasing your thread stack size? Seems[…]

I use PM 3.4. Android push works while IOS push do[…]

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

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