# How change Textbox value with Radio Buttons

**URL:** <https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642>\
**Category:** Get Help\
**Tags:** javascript, radio-buttons, conditional-logic\
**Created:** [August 27, 2021, 5:37pm UTC](https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642 "2021-08-27T17:37:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user61291ec7f3bc9543](https://avatars.discourse-cdn.com/v4/letter/u/13edae/32.png) [@user61291ec7f3bc9543](https://community.gravityforms.com/u/user61291ec7f3bc9543)\
**Post date:** [August 27, 2021, 5:37pm UTC](https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642/1 "2021-08-27T17:37:23Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/a/a9ac2bac254c66cfe73f4f03ed37a8f7193fe8f5.png)  
Hi!

I have two textboxes in my form. (W and H)  
values are numbers and 75cm\<W\<750cm and 75cm\<H\<180cm  
can you please help and guide me  
how I can change the textbox value with Radio Buttons and convert them to mm?!  
and as you know The allowable range of numbers must also be changed.

thank you

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [August 29, 2021, 12:22am UTC](https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642/2 "2021-08-29T00:22:46Z")

</div>

In this scenario, I recommend putting the radio buttons first, to offer the choice of cm or mm. Then you would have four fields, W in mm and W in cm, plus H in mm and H in cm. You would show the correct pair of fields based on the radio button selection that was made. Only one W and one H field would ever be shown. Would that work for you?

---

<div class="post-metadata">

**Author:** ![user61291ec7f3bc9543](https://avatars.discourse-cdn.com/v4/letter/u/13edae/32.png) [@user61291ec7f3bc9543](https://community.gravityforms.com/u/user61291ec7f3bc9543)\
**Post date:** [August 29, 2021, 2:43pm UTC](https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642/3 "2021-08-29T14:43:16Z")

</div>

Yes, The first case was done with your guidance  
But I still have trouble calculating

if {Unite\_C:10}=cm  
Price= ( {W\_CM:3}\*{H\_CM:4})_300  
if {Unite\_C:10}=mm  
price= ( {W\_MM:3}_{H\_MM:12}\*200

I think “IF” can not be used in the “Formula” section?  
Is there a better way to do such a calculation?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [September 28, 2021, 2:43pm UTC](https://community.gravityforms.com/t/how-change-textbox-value-with-radio-buttons/10642/4 "2021-09-28T14:43:51Z")

</div>

Closed on September 28, 2021, 2:43pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
