Pop up box with Form

Is there a way to Open a form from a Hyperlink in a popup module and then when you hit submit it would close the pop up?
Thanks

Dear Jennifer,
One thing you can do is use window.open() and window.close() for this particular operation.

Are we talking about SharePoint Form? If this is the case, read how URLs are constructed here - https://plumsail.com/docs/forms/how-to/redirect-sp-save.html

Then you can run the following code to open a new window:

//get listId from the URL of the form where you want to redirect users to
var listId = "a7f8e595-9909-46a7-96f5-2c99cec563ae";
var URL = "https://domain.sharepoint.com/sites/sitename/_layouts/15/listform.aspx?PageType=8&ListId=" + listId;
window.open(URL, "_blank", "width=400, height=400");

To get List ID:

You can also use the following code on the desired form, in the JS editor, so it closes after submission:

fd.spSaved(function(result) {
    window.close();
});