Login Register

non-dijit form elements in a dialog

Is it possible to have form elements in a dijit.Dialog that get POST'd when the form is submitted? For example in the following code (adapted from the dijit.Dialog example in the docs):



Dialog demo
    
        @import "http://o.aolcdn.com/dojo/1.0/dijit/themes/tundra/tundra.css";
        @import "http://o.aolcdn.com/dojo/1.0/dojo/resources/dojo.css"
    
    
    
       dojo.require("dojo.parser");
       dojo.require("dijit.form.Button");
       dojo.require("dijit.Dialog");
       dojo.require("dijit.form.TextBox");

       function checkPw(dialogFields) {
          alert(dialogFields.confirmpw); 
       }
     


Change Password
OK

This works as expected (displaying whatever you put in the textbox in an alert). However, if I remove the 'dojoType="dijit.form.TextBox' from the then the value isn't passed on.

I'm particularly interested in this as I'd like to have a file upload element in a form in a Dialog and there doesn't appear to be a dijit.form.input type I can use. I see dojox.widget.FileInput but it's not clear that's going to work reliably (being in dojox and all). I'd be happier if I could just get a standard to work.

Should work

I do this all the time. I enclose the form inside the Dialog in tags, though, would this be the problem? Rendered dijit.form.TextBox is an ordinary text input element (look the HTML source of your dialog), so there should be no reason why it doesn't work.

Anni