<from action="" method="post">
<table>
<tr>
<th>公司名称:</th>
<tr>
<th>部门:</th>
<td id="departmentOptions">
</td>
</tr>
</table>
</from>
在上述代码中,异步获取回来的HTML块替换表格中id为departmentOptions的一行,<from></from>标签一定要把<table></table>标签包含在里面,否则提交表单到后台,后台程序获取不到异步获取并嵌入的部分。
<table>
<tr>
<th>公司名称:</th>
<td>
<html:select value="" property="companyId" οnchange="ajaxGetDepartment('departmentOptions', '${url}'+this.value);">
<html:options collection="companyOptions" property="value" labelProperty="label" /></html:select>
</td>
</tr><tr>
<th>部门:</th>
<td id="departmentOptions">
</td>
</tr>
</table>
</from>
在上述代码中,异步获取回来的HTML块替换表格中id为departmentOptions的一行,<from></from>标签一定要把<table></table>标签包含在里面,否则提交表单到后台,后台程序获取不到异步获取并嵌入的部分。