I am using Chronoforms in Joomla!. My form contains a radio group that that does not have the "required" flag. In my emailtemplate I have a reference to that radio group like this: {radio2} Now whenever the user does not make a selectiaton on that group, the email that is beeing sent contains the actual "{radio2}" string. How can I make Chronoforms display an empty string if no selection was made?
Forums
leave {radio} field empty if no selection was made
Hi bitbonk,
The answer is here in the forums several times.
Forms do not return any response for unchecked checkboxes or radio buttons. And ChronoForms is not clever enough to know that there 'should' be a value unless you tell it.
In the OnSubmit Before box add a code snippet like this:[list]<?php
$radio2 =& JRequest::getString('radio2', '', 'post');
JRequest::setVar('radio2', $radio2);
?>[/list]This will make sure that the value is set to '' if the user doesn't choose any button - you can replace that with some other default value like 'empty' or 'No' if you prefer.
Bob
The answer is here in the forums several times.
Forms do not return any response for unchecked checkboxes or radio buttons. And ChronoForms is not clever enough to know that there 'should' be a value unless you tell it.
In the OnSubmit Before box add a code snippet like this:[list]<?php
$radio2 =& JRequest::getString('radio2', '', 'post');
JRequest::setVar('radio2', $radio2);
?>[/list]This will make sure that the value is set to '' if the user doesn't choose any button - you can replace that with some other default value like 'empty' or 'No' if you prefer.
Bob
This topic is locked and no more replies can be posted.