• Payment Plugins Poll

    We need your feedback on the need for updated payment plugins. Please go here and give us your feedback.

  • Joomla 5.1

    For running J!5.1 you must install Fabrik 4.1
    See also Announcements

  • Subscription and download (Fabrik 4.1 for J!4.2+ and J!5.1) are working now

    See Announcement
    Please post subscription questions and issues here

    We have resolved the issue with the J! updater and this will be fixed in the next release.

Not empty validation for GPS coordinates

mirceat

Member
Hello,

I have the following not empty validation applied for several elements that should check if another field element is not empty.
return (string)'{contracts_tool_servicii_765_repeat___adresa_anexa_vpn_nou_raw}' !='';

Works fine for any value (text, number etc) except GPS coordinates like 44° 25' 36.363" N 26° 6' 9.138" E.

After Submit I get this error:

0 syntax error, unexpected '36.363' (T_DNUMBER), expecting ';'
C:\webserver\Apache24\htdocs\dev\components\com_fabrik\models\validation_rule.php(149) : eval()'d code:1

I tried to addslashes to the string but it doesn't work, same error.
$adresa = (string)'{contracts_tool_servicii_765_repeat___adresa_anexa_vpn_nou_raw}';
return filter_var($adresa, FILTER_SANITIZE_ADD_SLASHES) !='';

What can I do to run this validation?

Thank you
 
Where are you doing this?
Try to use a Fabrik element variable, not the placeholder (I assume you'll get such an error always with strings containing ' and ").

So something like
JFactory::getApplication()->input->get('contracts_tool_servicii_765_repeat___adresa_anexa_vpn_nou_raw'); //resp. the new J!4 syntax
or one of these
 

Members online

No members online now.
Back
Top