Dexterity and conditional statements

Is there a way to add conditional statements in Dexterity's product source code? If someone chooses an option in a particular field, it triggers a field that was once hidden to show up. Any help would be most appreciated.

That should help:

In general you want to implement this in Javascript.
MasterSelectWidget for the special case with dependent select elements.


tmassman and zopyx. Thank you for your advice. I am going to try the Javascript option first. zopyx, do you have an example that I can look and learn from for a dexterity product?

Registering a custom a custom JS script in Plone 4 and 5 is covered in depth by the documentation. Also using selectors on forms using jQuery...sorry, that's basic web developer know-how covered by zillions of blogs and docs.


Thanks zopyx. Yes, I have done a lot of them myself as well. Just wondering whether using it with Dexterity requires something different. I have done jQuery on PloneFormGen forms before, just not in Dexterity, and also within a product. I am not sure if I needed to incorporate it within model_source in the profiles/default/xml file or does it need to be pulled in from the theme itself. This is where I am lost.