As you've probably discovered, there is no way to do this directly via a script. There are some other possibilities:
1) Layer two copies of the same field on top of each other, then use a Script Trigger / button to go to the correct one.
2) Use a "cascading value list" (search this forum for examples). Basically, you make the value list conditional on the selection in the Category field.
3) Use a dynamic value list built in data via a portal inside a popover instead of a plain vanilla value list. (This is usually done by way of the Virtual List technique.)
All depends on exactly what you're trying to accomplish.