Share form script code

Share form script code

Can you please allow us to create common/shared script functions for forms.

Right now I need to repeat code across:
* Add -> On Load
* Edit -> On Load
* Field -> On User Input

The scenario is a Drop Down field called 'Type' that controls hide/show of other fields on the form.

Having to repeat the script across multiple places is a maintenance pain.

A custom function will not work as you can do no UI operations.