If you need to fill in some info in an alert you should use the spjs.modal instead – bring up the developer toolbar by hitting f12 and type in this to see all options:
spjs.modal.help();
Collecting info from a dialog and passing it back to the form is not a functionality that is available so the HTML elements must be added in the “html” argument to the function, and the code used to pass the data back to the form must be written in the “ok” function.
Here is an example:
spjs.modal.add({
"title": "Enter your phone number",
"html": "<input type='text' id='phone_number_input' style='width:100%;box-sizing:border-box'>",
"ok": function () {
var title = jQuery("#phone_number_input").val();
setFieldValue("phone_number", title);
}
});
Alexander