• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: PHP email script : if no radio button is clicked?

PHP email script : if no radio button is clicked? 2 weeks 2 days ago #39742

  • serazoo
  • serazoo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hello guys!
Please guide me :)
This below script is exactly what I need, but for a radio button : if non of the radio buttons are clicked, then don't show caption nor value.
Thx

$modAdminEmailText = $form->AdminEmailText;

/*Checks if the field has a value and if so, add it to the Email Text*/
if($_POST != '')
$modAdminEmailText .= '{your_field_name:caption}: {your_field_name:value}';

if($_POST != '')
$modAdminEmailText .= '{your_field_name2:caption}: {your_field_name2:value}';

/*After the field placeholders are added we will need to replace them with the actual submitted values.*/

$adminEmail = $modAdminEmailText;
$adminEmail = str_replace($placeholders, $values, $adminEmail);
The administrator has disabled public write access.

PHP email script : if no radio button is clicked? 1 week 1 day ago #39781

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 542
  • Thank you received: 114
Hello,

You don't necessarily need a PHP script for this since RSForm!Pro provides a specialized IF statement syntax which can be added directly in your email body.

If you still want a scripting approach, then you can use the following to check if a radio is selected or not (whereas myRadioGroupNameHere is the exact name of your radio group element; case sensitive):
if(isset($_POST['form']['myRadioGroupNameHere']))
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: serazoo
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!