Title: Help with Radio Button
Last modified: March 17, 2019

---

# Help with Radio Button

 *  Resolved [matt130190](https://wordpress.org/support/users/matt130190/)
 * (@matt130190)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/)
 * IF(fieldname12 == ‘Metric’) return ‘False’;
 * Fieldname 12 is a radio button with Metric & Imperial options why is this not
   returning False when metric is selected ??
 * I’ve tried setting the value of Metric to 1 and imperial to 2 but this still 
   does not work.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhelp-with-radio-button%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [matt130190](https://wordpress.org/support/users/matt130190/)
 * (@matt130190)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11322985)
 * Just to summarize eventually I would like
 * If metric selected calculate (Lxwxh)/1000 to get volume in liters
    If I imperial
   do (((l*w*h)*2.54)/1000)
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11322986)
 * Hello [@matt130190](https://wordpress.org/support/users/matt130190/)
 * You are confusing the operation “IF” distributed with the plugin, and the “if”
   conditional statement of javascript (remember that javascript is a case sensitive
   programming language)
 * For example, assuming you want to return the text False if fieldname12 value 
   is Metric and the text True in other cases.
 * Using the “IF” operation distributed with the plugin:
 *     ```
       IF(fieldname12 == 'Metric', 'False', 'True')
       ```
   
 * Pay attention, the “IF” operation requires three parameters: condition, operations
   if the condition is true, and operations if the condition is false.
 * Now the same equation using the javascript conditional statement “if”. In this
   case you require to implement the equation with function structure:
 *     ```
       (function(){
       if(fieldname12 == 'Metric') return 'False';
       return 'True';
       })()
       ```
   
 * A third alternative using the ternary javascript operator:
 *     ```
       (fieldname12 == 'Metric') ? 'False' : 'True'
       ```
   
 * Best regards.
 *  Thread Starter [matt130190](https://wordpress.org/support/users/matt130190/)
 * (@matt130190)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11323031)
 * Hi
 * Thank you for your quick reply unfortunately it’s still not working 🙁 I’m not
   sure if this will work but please see photos below
 * [Photos](https://photos.app.goo.gl/sofYTsXgSt1e1iBQA)
 * It doesn’t seem that radio button is being recognized
 * Thanks so much in advance
 * So in theory it should display false unless metric is selected then display true
    -  This reply was modified 7 years, 6 months ago by [matt130190](https://wordpress.org/support/users/matt130190/).
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11323062)
 * Hello [@matt130190](https://wordpress.org/support/users/matt130190/)
 * In the equations you always use the values of the fields and not the texts of
   the choices. The checkbox: “Value to submit” only affects to the value to submit
   and not to the equations, so, the equation would be:
 *     ```
       (function(){
       if(fieldname12 == 'X') return 'False';
       return 'True';
       })()
       ```
   
 * Best regards.
 *  Thread Starter [matt130190](https://wordpress.org/support/users/matt130190/)
 * (@matt130190)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11323066)
 * Yay is now working, thankyou so much 🙂

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

 The topic ‘Help with Radio Button’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](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/)

 * 5 replies
 * 2 participants
 * Last reply from: [matt130190](https://wordpress.org/support/users/matt130190/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/help-with-radio-button/#post-11323066)
 * Status: resolved