Edit form: custom php code (and DB query) on submit

eulanaz

Member
Dear all,

I'm trying to run a specific php code in an edit form when the save button is clicked (and avoid the normal code to be executed).

What I need is to check if a specific element is changed and if yes, run a custom query through a php script.

I've tried to use the Plug-ins "php" only in Edit Frontend with "Start of form submission (onBeforeProcess)" using a custom php code but I have the same situation as before. If I use an existing php script as dump.php, something is change, but not with my code.

Here my question:

- Is possible to run a specific php code when the save button is clicked on an edit form? To be more detailed, the list is a "view" and is not possible to run an update query, but I need to change values of others tables without receiving the SQL error.

Any help, indication or example is welcome

Thanks in advance

eulanaZZ
 
If you return false from your code, you can abort our form processing. Although I think that would reload the form with a generic error msg.

Or you can redirect ...

Code:
JFactory::getApplication()->redirect('index.php?whatever...');

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top