37
Views
9
Comments
Solved
At least one checkbox required.
Question

Hi,

I am working on a form in reactive web app and in that from user have to select at least one checkbox from group of options.

So basically I want to show required * sign on all check-boxes and if user selects one I want required* sign to  disappear.

Rank: #631
Solution

Nannu wrote:

Miguel Chaparra wrote:

Hi Nannu, 


You can use the ListFilter action to filter your Structure List.

 

The ListFilter will return a FilteredList satisfying the given condition, with that you can assign your Var with the lenght of the returned list (e.g. Var = ListFilter.FilteredList.Length)


Hope it helps,


Regards,

Miguel Chaparra

 Hi Miguel,

Data type is not list. It's of type structure which has different boolean attributes.

Thanks.

 

 Hi Nannu,


If I understand it right your Structure save and display data in the following way:

I think would be better change the output for a list of booleans instead, If you can't or don't have access to do that then the only option I can think about is by using several If for each attribute where you increment your Var if it's true.


Regards,

Miguel Chaparra


Rank: #631

Hi Nannu,


I think you can use a Local Variable to save how much Checkboxes were selected, that way you know if the user selected at least one Checkbox. 

Set an OnChange event in your Checkbox. There check if the checkbox is selected or not, if it is selected increment your Local Variable (e.g. Var=Var+1), if not, decrement (e.g. Var=Var-1).

Then you can use an if Var<1 to show your required sign (*).


Hope it helps,


Regards,

Miguel Chaparra

Rank: #137

Hi Nannu,


Please check attached oml.

Hope this help you.


Vijay M -

ValidateCheckBox.oml

Rank: #631

Hi Nannu, 


You can use the ListFilter action to filter your Structure List.

 

The ListFilter will return a FilteredList satisfying the given condition, with that you can assign your Var with the lenght of the returned list (e.g. Var = ListFilter.FilteredList.Length)


Hope it helps,


Regards,

Miguel Chaparra