Hi,
I have Joomla 1.5.9, Chrono and Chrono Forms 1.2 Connectivity v. 3.1 RC5.0. I explain my situation.
I have a form with which I add records to a table, this is server side form validation code:
Where the table has two fields registroProvincia; provincia and time, and the provincia before being stored need not be time before and had to be Ej: 12:00 two numbers (:) two numbers.
Show all data through Chrono Connectivity and everything is perfect, except that when I edit the content of any of the fields when I save, it saves but does not meet the rules of the server side form validation code, though I have since the same code above in Chrono Connectivity in OnSaveCode.
My question is, what I do wrong? What if there are any other ways to edit a content, to establish a validation code for that code published?
Thanks.
I have Joomla 1.5.9, Chrono and Chrono Forms 1.2 Connectivity v. 3.1 RC5.0. I explain my situation.
I have a form with which I add records to a table, this is server side form validation code:
<?php
global $mainframe;
jimport ( 'joomla.database.database');
$db =& JFactory::getDBO();
$query = "SELECT provincia FROM jos_chronoforms_registroProvincia";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row){
$param = $row->provincia;
if (JRequest::getVar('provincia') == $param)
return 'Error: Pronvicia is already';
}
$time = JRequest::getVar('time', '', 'post');
if (!preg_match('/^[0-9]{2}([: ]?[0-9]{2})?$/',
$time))
return 'Error: Time must nn(:)nn Ej: 12:00';
?>
Where the table has two fields registroProvincia; provincia and time, and the provincia before being stored need not be time before and had to be Ej: 12:00 two numbers (:) two numbers.
Show all data through Chrono Connectivity and everything is perfect, except that when I edit the content of any of the fields when I save, it saves but does not meet the rules of the server side form validation code, though I have since the same code above in Chrono Connectivity in OnSaveCode.
My question is, what I do wrong? What if there are any other ways to edit a content, to establish a validation code for that code published?
Thanks.