mage a generic function for setting up ajax editor forms