Change .to() based on dropdown input
Created 7 years ago by myshoeshurt

Heya, quick question regarding forms. Let's say I have a dropdown inside one form and it's got 4 different options to select. Is it possible to alter the .to() option or .cc() in that form based on the dropdown selection? If yes, what would be the best approach?

Thank you very much!

ryanthompson  —  7 years ago Best Answer

The best way to do this is probably using a handler / setting a handler and changing the option within that logic.

...handler(MyHandler/Class)...

That should set it OK within Twig

myshoeshurt  —  7 years ago

Thanks dude, it took some time to make it work, but it works perfectly 😄