dobtco's formbuilder is what we used: https://github.com/dobtco/formbuilder
It might take some tweaking to make it work for your use case, but it's a start. The nice thing is it outputs JSON, which you can parse when you're rendering the resulting form.