keith21
Member
Hi guys
I have a cal element to calc a address on a single line. The code works fine on the Form view, does as it should. But for some reason any items saved in the database show up in list view on the top. Its really strange, its concatenating all single line addresses into one. This only does it when the calc element is set to "Ajax calculation".
I have the code below and also some pics to show the issue.
Thanks
Keith
I have a cal element to calc a address on a single line. The code works fine on the Form view, does as it should. But for some reason any items saved in the database show up in list view on the top. Its really strange, its concatenating all single line addresses into one. This only does it when the calc element is set to "Ajax calculation".
I have the code below and also some pics to show the issue.
Thanks
Keith
Code:
$prid = "{sin_prid___prid}";
$line1 = "{sin_prid___addline1}";
$line2 = "{sin_prid___addline2}";
$line3 = "{sin_prid___addline3}";
$city = "{sin_prid___citytown}";
$county = "{sin_prid___county}";
$postcode ="{sin_prid___postcode}";
$country = "{sin_prid___country}";
if (!empty($prid) || !empty($line1) || !empty($line2) || !empty($line3) || !empty($city) || !empty($county) || !empty($postcode) || !empty($country))
{echo implode(',', array_filter([$prid,$line1, $line2, $line3, $city, $county, $postcode, $country], 'trim'));}
else
{ echo "";}