Modules dialogs - access elements on submit button

Hi Team,

Do we have any ways to get access to elements on dialog window for validation / api calls before it closes.

I am looking at the use case where we can have form on dialog module with submit button - onclick of the submit button needs to make api calls after getting the values form html elements.

i did look into the documentation in Dialog but no example such.

could you please advise.