Trigger a php code by change values on dropdown

How to trigger PHP code when a dropdown value changes.

Overview

The problem is that PHP requires a server request to execute, which cannot be done directly from a client-side dropdown change.
Set up a trigger on the dropdown to run a JavaScript function that uses AJAX to call a form page where the PHP code is executed. This feature is available in CF v8.0.29 and later.

Answered
ChronoForms v8
lo lollymaster 20 Aug, 2024

Hi all,

i need an help to run a php code triggered by a value changes from a dropdown choice.

is there a possibility to do it?

Thanks,

Lorenzo

Max_admin Max_admin 10 Sep, 2024
Answer

Hi Lorenzo

Running PHP requires a server request, you can setup a trigger on the dropdown then listen on the same dropdown or another element, run a javascript function which calls a form page using AJAX (XHR) where you will run your PHP code

this is a feature which can be added to a future release

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin Max_admin 26 Nov, 2024

this feature has been added to v8.0.29

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.