View Single Post
Old 14th January 2013, 18:46
mare mare is offline
Junior Member
Join Date: Mar 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default onBeforeInsert generating table value


I use onBeforeInsert in my table_edit.php to generate a value which should be added to the database (will come from another subsystem so it's not available during the form input).

currently i do the following but thing there is a better solution .

function onBeforeInsert()
              global $app 
              $app->tform->errorMessage = myfunction($_POST) ;
              $this->dataRecord['value'] = $_SESSION['value'] ;
              unset ($_SESSION['value']) ;
global $_SESSION ;
if (ok) 
$_SESSION['value'] = "foo";
return "error foo :-(" ;
Reply With Quote
Sponsored Links