If the dialog is being opened, then you should be able to use the dijit/registry
module to retrieve your form fields (and thus, also your values/data).
For example:
require([ "dijit/registry" ], function(registry) {
registry.byId("ok").on("click", function() {
registry.byId("address").get("value"); // Will return the "address" value
});
});
The question of course is, when do you add the onClick
event handler to your button. You have to wait until the dialog is loaded until you can add an event handler to it. Good thing, the dijit/Dialog
has an event called onLoad
which we can use.
For example:
myDialog.on("load", function() {
registry.byId("ok").on("click", function() {
registry.byId("address").get("value"); // Will return the "address" value
});
});
However, if you're interesting in submitting all form data, you should take a look at the dijit/form/Form
widget which allows you to get/set the form values, validate the form and submit it as well.