Hi,
I would like to create a form where user select values in 2 fields (first field is dropdown and second field radio button), then according to the combination of those 2 values I would like to output an html message.
How can I do that?
Thanks in advice.
I would like to create a form where user select values in 2 fields (first field is dropdown and second field radio button), then according to the combination of those 2 values I would like to output an html message.
How can I do that?
Thanks in advice.
Hi deltafidesign,
You can do that with PHP in a Custom Code element in the form On Submit action.
Bob
You can do that with PHP in a Custom Code element in the form On Submit action.
Bob
Thanks GreyHead for your reply.
Could you please suggest me the PHP code I should use? I'm not gode in PHP.... sorry. :-(
Could you please suggest me the PHP code I should use? I'm not gode in PHP.... sorry. :-(
maybe this article help
Hi deltafidesign,
Here's an example assuming that the drop-down has values aaa and bbb and the radio button xxx and yyy
Bob
Here's an example assuming that the drop-down has values aaa and bbb and the radio button xxx and yyy
<?php
$message = '';
if ( $form->data['drop_down'] == 'aaa' && $form->data['radio_button'] == 'xxx' ) {
$form->data['message'] = 'this message';
} elseif ( $form->data['drop_down'] == 'aaa' && $form->data['radio_button'] == 'yyy' ) {
$form->data['message'] = 'this message';
}
} elseif ( $form->data['drop_down'] == 'bbb' && $form->data['radio_button'] == 'xxx' ) {
$form->data['message'] = 'some other message';
}
} elseif ( $form->data['drop_down'] == 'bbb' && $form->data['radio_button'] == 'yyy' ) {
$form->data['message'] = 'this last message';
}
?>
Bob
This topic is locked and no more replies can be posted.