Single selection in choice (checkbox list)

  • 12 April 2017
  • 2 replies
  • 102 views

Badge +2

Hi,

 

I am currently working on a scenario where in I have to display the data in checkbox list pattern but I have to restrict the user from selecting multiple values.

I am using choice control for that.

 

If anyone have any workaround for this then please share.

 

Divya Raj


2 replies

Badge +9

Hi DR0607,

 

you can achive this using jQuery script

 

  • Give some name to your Choice List ex. "ChkListUsers", By default it eill be Choice.
  • use jQuery on change for all the controls with name like "ChkListUsers"
  • add condition if checked items count is 1 then set not selected as disabled
  • and if  checked items count is 0 then set not selected as enabled

 

for more information on this refer Restrict selection count in choice checkbox List By K2Guys

 

 let me know if it helps you.

Badge +2

thanks Karan,

 

It worked and I tried another way also using expression only

for that I took a datalabel which will store the last selected value of Checkbox list and as soon as user select 2nd value from checkbox I am eliminating the previous value from the new selection and assigning itr back to the checkbox list. :)

 

btw thats for showing another way also.

 

Thanks,

Divya Raj

 

Reply