Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
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
#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.
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));
   }  
});

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]