Hi All.
First of all, i'm not a programmer🙂 I'm using Joomla and CF5 to create a Company's Intranet.
I've learned many things about php js, css ecc ecc and i'd like to do this on my form:
I've field called "codice_fiscale" (it's a italian unicode for people).
Workers have to input this code into the form to add it on Database.
I'd like to check if the data is already exist on the db but not on submit (i know to do it) but after leave the field.
Is it possible?
I've tried to follow this topic https://www.chronoengine.com/forums/posts/t92827/validate-on-existence-client-id-from-database but no result....
The code that i have created is this:
<?php
include "file_include/master.php";
$query = "
SELECT COUNT(codice_fiscale)
FROM $ana_dip_generale
WHERE `codice_fiscale` = '{$form->data['codice_fiscale']}' ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count > 0 ) {
$form->validation_errors['codice_fiscale'] = "This client id already exists.";
return false;
}
?>
First of all, i'm not a programmer🙂 I'm using Joomla and CF5 to create a Company's Intranet.
I've learned many things about php js, css ecc ecc and i'd like to do this on my form:
I've field called "codice_fiscale" (it's a italian unicode for people).
Workers have to input this code into the form to add it on Database.
I'd like to check if the data is already exist on the db but not on submit (i know to do it) but after leave the field.
Is it possible?
I've tried to follow this topic https://www.chronoengine.com/forums/posts/t92827/validate-on-existence-client-id-from-database but no result....
The code that i have created is this:
<?php
include "file_include/master.php";
$query = "
SELECT COUNT(codice_fiscale)
FROM $ana_dip_generale
WHERE `codice_fiscale` = '{$form->data['codice_fiscale']}' ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count > 0 ) {
$form->validation_errors['codice_fiscale'] = "This client id already exists.";
return false;
}
?>