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

Moderator: amosbatto

By JeniferAntony
#825038
Please help me to achieve this. User can select 2 values then the list should be disabled. But at the same time user can de-select the values which is already selected. Then all the options should be available as the length is one.
If the length is equal to 2 then we need to block the selection.
User avatar
By amosbatto
#825082
JeniferAntony wrote: Fri Jun 21, 2019 3:23 am Hello All,
I need to limit the Multi select list box to 2. User could select only 2 values.
Refer the link: https://wiki.processmaker.com/3.0/Dropd ... %20Listbox
Regrads,
Jenifer
I created a programming example to explain this:
https://www.pmusers.com/index.php/Minim ... _a_listbox
User avatar
By amosbatto
#825083
JeniferAntony wrote: Fri Jun 21, 2019 3:26 am Please help me to achieve this. User can select 2 values then the list should be disabled. But at the same time user can de-select the values which is already selected. Then all the options should be available as the length is one.
If the length is equal to 2 then we need to block the selection.
You can disable the listbox with this code:
$("#myListboxId").getControl().prop("disabled", true);

But if you do that, then there is no way to change the selected items. You will have disable individual options in the listbox. Sorry, but I'm already spent an hour preparing the previous example for you so you will have to figure it out on your own.
User avatar
By amosbatto
#825103
Oh, I just noticed that you posted this under ProcessMaker 2. Are you using version 2?
By JeniferAntony
#825116
Hello Amos,

The following solution is working.
Code: Select all
$("#var_Dropdown_Multiselect").setOnchange(function(newVal, oldVal){
    if (newVal.length > 3) {      
    $("#var_Dropdown_Multiselect").setValue(eval(oldVal));
   }  
});
SOAP-ERROR: Parsing WSDL

Hello there, We are using PM Enterprise version 3[…]

Detail information, thanks for your sharing.

Don't forget to unblock the core tables: https:/[…]

Oh, Really thank you Amos