87,955
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
<form id="categoryForm" action="addCategory">
<s:hidden id="id" name="id"/>
<label for="name">Name</label><input dojotype="dijit.form.TextBox" id="name" type="input" name="category.name"/>
<input type="submit" id="button" dojotype="dijit.form.Button" label="Add" />
</form>
dojo.connect(button, "onClick", function(event){
event.preventDefault();
event.stopPropagation();
var xhrArgs = {
form: dojo.byId("categoryForm"),
preventCache:true,
handleAs: "json",
load: function(data){
},
error: function(error){
alert(error.message);
}
}
var deferred = dojo.xhrPost(xhrArgs);
<form id="categoryForm" action="addCategory" dojotype="dijit.form.Form">
<s:hidden id="id" name="id"/>
<label for="name">Name</label><input dojotype="dijit.form.TextBox" id="name" type="input" name="category.name"/>
<input type="submit" id="button" dojotype="dijit.form.Button" label="Add" />
</form>