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
#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));
   }  
});

Hi. Have you tried to use JavaScript on your Dyn[…]

Hi Please, could you send information about the c[…]

Dashboard issue

Can you show me what you were trying to do in orde[…]

I want to make the Jalali calendar in all of[…]