I'm not very clear on what you're up to but you can construct a variable consisting of HTML form tags as needed and use JavaScript to display that variable in a Custom HTML Prompt
.
I do that to construct select
form elements in a few of my macros, like Mirror Mirror, which shows the general approach.