1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| require(["dijit/form/Form", "dijit/form/TextBox", "dijit/form/CheckBox", "dijit/form/Button"], function(form, textBox, checkBox, button){
dojo.query("form").forEach(function(formulaire){
new form({
method: formulaire.method,
action: formulaire.action,
onSubmit: function(e){
console.log(e.target);
}
}, formulaire);
});
dojo.query("input[type='text'], textarea, input[type='email'], input[type='password']").forEach(function(input){
new textBox({}, input);
});
dojo.query("checkbox").forEach(function(checkbox){
new checkBox({
checked: false
}, checkbox);
});
dojo.query("button, input[type='submit']").forEach(function(but){
new button({
label: but.value
}, but);
});
}); |
Partager