Forums

ChronoForms and ChronoConnectivity in OnSaveCode

mismamentetu2009 31 May, 2009
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:


<?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.
GreyHead 01 Jun, 2009
Hi mismamentetu2009,

At present ChronoConnectivity doesn't support server-side validation so your error finding code won't do anything except show the error message.

There's a new version of ChronoConnectivity that Max is developing that will be more closely linked to ChronoForms so this might solve the problem.

You could link a ChronoForm to the Edit link in ChronoConnectivity; or you could use a better time input in your edit form. Either hours+ minutes dropdowns or a time spinner (see the Watchman plugin) woudl fix this for you.

Bob
Max_admin 01 Jun, 2009
Hi mismamentetu2009,

As Bob said, there is a new version of Connectivity and Chronoforms coming and your issues will be solved! give me a day or 2 to add the final touches to the 2 releases!

Cheers,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
mismamentetu2009 01 Jun, 2009
Thank you very much Bob and Max.

Watching the Watchman plug-in and wait for all the updates, since I liked Chrono Connectivity, who did not know him before.

But one last question, how do you connect to a form the connectivity?
Max_admin 14 Jun, 2009
Hi mismamentetu2009,

I was off for sometime, please let me know if you still have troubles with this

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.