what you need here is the pasteHTML method of the VFE.. I do not think it can be used with Form API but a little thought to the same may help you find a solution