I’ve been using this combination for a few projects recently.
jQuery dForm is a really nice little library that takes so much hassle out of creating and editing forms.
It effectively stores forms as JSON objects which you can save to a database field, read in to edit the form and save again.
Of course, you want forms to work whether the user has javascript on or not – and that’s where PhantomJS comes in.
PhantomJS is basically a headless Webkit browser – the same engine that powers Google Chrome and Apple Safari. Point it at a page that renders the form created with jQuery.dForm, grab the html that’s rendered and either publish that html out to a file or store the html in different database field.