<form dojoType="dijit.form.Form" id="myForm" onsubmit="alert(dojo.toJson(this.getValues(),true));">
</form>
说明:当执行submit时,form中的数据会转化成json格式字符串提交到后台。
==================================================================================
<form method="post" action="" id="myForm">
<LABEL>username</LABEL>
<input name="username" type="text">
<BR>
<LABEL>password</LABEL>
<input name="passowd" type="text">
<BR>
<LABEL>emails</LABEL>
<input name="email1" type="text">
<BR>
</form>
<BUTTON id=loginbutton>login</BUTTON>
function login() { var formData = dojo.formToJson("myForm"); }
原文链接:https://www.f2er.com/dojo/291736.html