# Add multiple values from 2 inputs to one post variable

**URL:** <https://community.gravityforms.com/t/add-multiple-values-from-2-inputs-to-one-post-variable/10403>\
**Category:** Get Help\
**Tags:** gform\_pre\_submission\
**Created:** [July 23, 2021, 3:31pm UTC](https://community.gravityforms.com/t/add-multiple-values-from-2-inputs-to-one-post-variable/10403 "2021-07-23T15:31:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![creativeclicks](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@creativeclicks](https://community.gravityforms.com/u/creativeclicks)\
**Post date:** [July 23, 2021, 3:31pm UTC](https://community.gravityforms.com/t/add-multiple-values-from-2-inputs-to-one-post-variable/10403/1 "2021-07-23T15:31:09Z")

</div>

I’m fairly novice so please bear with me…  
I’m trying to grab values from a checkbox and depending on the selection, I have conditional logic set to show two further radio button options and I need to grab that value also. I’ve looked at how to concatenate values and have come up with the following:

if ($\_POST[‘input\_48’] == ‘ValueX’)  
{  
$\_POST[‘input\_48’] = rgpost( ‘input\_48’ ) . “\n” . rgpost( ‘input\_50’ );  
} else {  
$\_POST[‘input\_48’] = $\_POST[‘input\_48’];  
}

Some further detail…

1.) If checkbox one is selected \> no further conditional logic \> grab the value of input field

2.) If checkbox two is selected \> conditional logic and show two radio button options \> Add that selected option to the checkbox value and join them up

Any help would be appreciated.

---

<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:** [July 23, 2021, 3:33pm UTC](https://community.gravityforms.com/t/add-multiple-values-from-2-inputs-to-one-post-variable/10403/2 "2021-07-23T15:33:51Z")

</div>

The concept of this code looks OK. Where do you need help? Is something not working for you? We’ll need more detail (all the code including the `add_filter` line, and to see the form) to know where this is going wrong. Additionally, the built in logging with your own custom logging statements will be a great help here, to see if this variables contain what you expect them to:

[Enabling logging](https://docs.gravityforms.com/logging-and-debugging/#h-enabling-logging)

[Adding your own custom logging statements](https://docs.gravityforms.com/custom-logging-statements/#writing-to-the-core-log)

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 5, 2022, 8:28am UTC](https://community.gravityforms.com/t/add-multiple-values-from-2-inputs-to-one-post-variable/10403/3 "2022-01-05T08:28:32Z")

</div>


