You can achieve this with custom validation function.
See this example:
set the radio required (eform="Parking space::1" in input), and then on the license plate input this:
eform="License plate::1:You want some parking space; please fill in your license plate:#FUNCTION checkLicenseplate"
and than make snippet with the function "checkLicenceplate", wich you include in the same page as the eform snippetcall, let’s say [!eFromExtrafunctions!]:
function checkLicenseplate( &$value ){
if( isset($_POST['parking']) && ($_POST['parking'] == "yes") ){
//parking set to yes: licenseplate required, check for REAL value
if($value != " " )
return true;
else return false;
}
//parking set to no: licenseplate not required, set to TRUE!
else return true;
}
As you can see, I check to see whether the parkingspace input is not " " (see the space); What you do is set the value of the licenseplate to 1 single space with an onfocus="this.select()", otherwise eForm will inform you that a value is required, even if a parking space is not required. You cannot turn ’required’ off ("License plate::0:.....) and have the extra functionality with the new function. If it is not filled, it will remain a space and therefore faulty when parking space is checked.
Hope you follow this...
I anybody alse has a better solution, I’d like to hear it too!