how to dynamically (with javascript) add a model to a save/cancel button

My guess would be that instead of a save cancel button you need to to a run multiple actions button and have one of your actions be to run a java script snippet that saves the models that were dynamically created.