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 silviuA
I have a dropdown control with the id "dropdown1" which is populated from a processmaker table using a sql query like : SELECT client_id, concat(client_name, ' ', client_lastname) FROM PMT_CLIENTS.
In a different text control, with the id "tex1", I obtain the client_id value from the database.

What I want is to use javascript to select the client in "dropdown1" based of the value of "text1".
I tried using :


but is not working, the dropdown1 shows the placeholder, not the client data.

It must be a simple matter because I did not find anything related on the forum or in the wiki, but I just don't know how to solve it. I would appreciate any idea you may have. Thanks.
As an extra info, I'm using Processmaker 3.2.1-community, and my JS skill is kinda low.
Your JavaScript code should work, if your "tex1" field contains the ID of one of your clients.

If you export the Dynaform and post the .json file and export the structure your PM Table and post it, then I will look at it.
Hi Amos and thanks for the quick reply.
Upon confirmation that the code should work, I investigated a little and found out that the jQuery plugin "select2" was interfering. I deactivated it for this specific control and everything is working as expected (well except for the fact that it is not showing the placeholder's value when nothing is selected, but that's no biggie).
Thanks again!
REST API Question

I am currently looking at developing a portlet for[…]

Everybody wants to be famous, but nobody wants to […]

Hi, I attached a sample config file, Please check […]

Error clicking on Participated

Hi, I attached a sample config file, Please check […]