Title: Conditional in checkboxes
Last modified: June 6, 2025

---

# Conditional in checkboxes

 *  Resolved [PB](https://wordpress.org/support/users/ohtusabes/)
 * (@ohtusabes)
 * [1 year ago](https://wordpress.org/support/topic/conditional-in-checkboxes/)
 * Hi [@codepeople](https://wordpress.org/support/users/codepeople/)
 * I am using checkboxes (fieldname45) with several options. Each option triggers
   dependencies that are HTML fields (for example, fieldname11, fieldname46, etc.).
   My intention is that some options exclude others when selected. For instance,
   if I select “Infección por Clostridioides difficile,” only its corresponding 
   HTML field should be shown, overriding the selection of “Historia de …”.
 * Is there a way to achieve this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fconditional-in-checkboxes%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [CodePeople2](https://wordpress.org/support/users/codepeople2/)
 * (@codepeople2)
 * [1 year ago](https://wordpress.org/support/topic/conditional-in-checkboxes/#post-18500881)
 * Hello [@ohtusabes](https://wordpress.org/support/users/ohtusabes/)
 * Thank you very much for using our plugin.
 * The simplest solution would be using radio buttons instead of checkbox fields,
   which allow you to select one choice at a time.
 * An alternative would be to use a calculated field as an auxiliary with an equation
   that contains conditional statements to evaluate the IGNOREFIELD or ACTIVATEFIELD
   operations.
 * E.g., fieldname1 is the checkbox field. The |r modifier allows you to access 
   the field raw values, and the |n tells the plugin you are referring to the field
   name instead of its value.
 *     ```wp-block-code
       (function(){if(IN('A', fielname1|r)) {IGNOREFIELD(fieldname2|n);IGNOREFIELD(fieldname3|n);}else{ACTIVATEFIELD(fieldname2|n);ACTIVATEFIELD(fieldname3|n);}})()
       ```
   
 *  Thread Starter [PB](https://wordpress.org/support/users/ohtusabes/)
 * (@ohtusabes)
 * [1 year ago](https://wordpress.org/support/topic/conditional-in-checkboxes/#post-18501133)
 * Hi [@codepeople2](https://wordpress.org/support/users/codepeople2/)
 * Thank you very much for your advice.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Conditional in checkboxes’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)

 * 2 replies
 * 2 participants
 * Last reply from: [PB](https://wordpress.org/support/users/ohtusabes/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/conditional-in-checkboxes/#post-18501133)
 * Status: resolved