title: Dojo domConstruct - Inserting rows into a table
body: <p>I'm working on an application that will allow people to select which data fields they would like a form to have. I had it working but when I tried to move the form fields into a table for a bit of visual structure I'm running into a problem.</p>
  
  <pre><code>  // Now print the form to a new div
    array.forEach(selectedFields, function(item, i) {
        var l = domConstruct.create("label", {
                                      innerHTML: item + ': ',
                                      class: "dataFieldLabel",
                                      for: item
                                  });
                                  var r = new TextBox({
                                      class: "dataField",
                                      name: item,
                                      label: item,
                                      title: item
                                  });
                                  var a = domConstruct.toDom("&lt;tr&gt;&lt;td&gt;" + l + r + "&lt;/td&gt;&lt;/tr&gt;");
                                  domConstruct.place(a, "displayDataForm");
  </code></pre>
  
  <p>When I run the code I can select the fields I want but instead of textboxes being drawn on the screen text like:</p>
  
  <p>[object HTMLLabelElement][Widget dijit.form.TextBox, dijit_form_TextBox_0]
  [object HTMLLabelElement][Widget dijit.form.TextBox, dijit_form_TextBox_1]</p>
  
  <p>Is printed to the screen instead. I think this is because I am passing domConstruct.place a mixture of text and objects. Any ideas about how to work around this? Thanks!</p>