compare checkbox with hidden box

wiesiuwies 20 Feb, 2013
Hello

What we need to do to compare chceckbox with hidden field ?. I mean when I clik submit without selected checkbox then form send also hidden field. What we must to do the submit button send only hidden files when checkbox is selected and vice versa ? For answer big thanks.

compare checkbox with hidden box image 1
GreyHead 20 Feb, 2013
Hi wiesiuwies,

I would use PHP in a Custom Code action to do this check after the form is submitted. You may not even need to use the hidden inputs.

Bob
wiesiuwies 21 Feb, 2013
Thanks Bob ... if you can tell me what the code Php should be look i will be grateful. Unfortunly my PHP i basic and I must looking for a help. One more thanks
GreyHead 22 Feb, 2013
Hi wiesiuwies,

It would be something like this:
<?php
$form->data['hidden_input'] = '';
if ( isset($form->data['checkbox']) && $form->data['checkbox'] ) {
  $form->data['hidden_input'] = 'Some value';
}
?>
Then you can use {hidden_value} in your email and it will either show '' or 'Some value'.

Bob
This topic is locked and no more replies can be posted.