i have created form in phtml file, now instead of calling the phtml file on CMS page i wan t call it using iframe. is it possible?.
How we can crate and show form using iframe in magento 2
You cannot call directly a phtml from an iframe (or url for that matter). A template has logic that needs to be interpreted.
Not sure why you want to display something in an iframe, but you can do it this way.
Create another page that includes a block rendered by your phtml (you may want to set the layout for this page to 'empty') and then include an iframe in your other page with the url of the previously created page.