Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 27, 2020

This code will allow the user to select more than one option when the 'other field' has a specific set of values (previously showed as radio buttons).
This is restricted to the "=" operator, since it would not be useful for the other operators.

It works by changing the radio buttons to checkboxes, and when the user selects more than one checkbox, the code will check if the current value is equal to one of the options selected.
When the user selects a different operator, a javascript function is triggered and changes the checkboxes back to radio buttons.

bp-conditional-profile-fields

The multiple choice is also reflected into the custom fields list as shown
bp-conditional-profile-field-admin

The prettifier has added a lot of edits into the js files, I'm sorry. To ease the task of looking for meaningful edits, in the "bp-conditional-field.js" file I've edited only the "match_condition" function, while in the "bp-conditional-field-admin.js" file I've added a function called "switchOtherFieldButtonType" and the two lines that use it.

@sbrajesh
Copy link
Owner

Thank you for your contribution. Please allow me 2 days to check and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant