Cake4: Beginner question. How use the ajax function

Sorry, I’m migrated a complete application from cake 1.2 to 4.2.
In the old version I had $ajax->observeField to permit me modify a select run time.
With the 4.2 I don’t find similar solution.
Thank’s for help me.

The Ajax helper went away a long time ago, due to the proliferation of JS solutions and impossibility of supporting all of them. There should be a load of non-Cake-specific tutorials out there about how to accomplish the same from the client side, and on the Cake side you just need to build an action that the client side can call.

As Cake is a server-side PHP framework I understand why they stopped attempting to support client-side javascript stuff.

I put together my approach to AJAX which uses both CSRF & form tampering protection here:-

I can only assume its a correct working approach as no-one yet has told me different!

Thanks for the answers both.