declarative dijits

An example of a button and dialog without a javascript block

by monteslu

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dijit/themes/claro/claro.css">
<div data-dojo-type="dijit.Dialog" data-dojo-id="myDialog" title="Name and Address">
    <table class="dijitDialogPaneContentArea">
        <tr>
            <td><label for="name">Name:</label></td>
            <td><input data-dojo-type="dijit.form.TextBox" name="name" id="name"></td>
        </tr>
        <tr>
            <td><label for="address">Address:</label></td>
            <td><input data-dojo-type="dijit.form.TextBox" name="address" id="address"></td>
        </tr>
    </table>

    <div class="dijitDialogPaneActionBar">
        <button data-dojo-type="dijit.form.Button" type="submit" id="ok">OK</button>
        <button data-dojo-type="dijit.form.Button" type="button" onClick="myDialog.onCancel();"
                id="cancel">Cancel</button>
    </div>
</div>

<button data-dojo-type="dijit.form.Button" type="button" onClick="myDialog.show();">
    Show me!
</button>