FreeMarker 页面动态加载多个select下拉

FreeMarker页面动态加载多个select下拉,并根据selectid,取得对应的信息

<tbodyid="productCategory">

<tr>

<thwidth="5%">

<imgsrc="../img/add.png"onClick="addProdPricTr();"/>

</th>

<thcolspan="2">商品分类</th>

</tr>

<#assigncount=0>

<#listcategroyMaps?if_existsascategory>

<trid="trProPric${category_index+1}">

<td>

<imgsrc="../img/delete.png"onClick="removeTd('${category_index+1}')"/>

<td>

<fontcolor="red">*</font>

<SELECTid="categoryIds${category_index+1}"name="categoryIds"style="width:150px"onchange="ChangeCategory('${category_index+1}')">

<optionvalue="">--选择分类--</option>

<#listallCategroysascate>

<optionvalue="${cate.id}"<#ifcate.id==category.categoryId>selected</#if>>

<#ifcate.categoryLevel==1>

<#else>

<#list1..cate.categoryLevelasa>-</#list>

</#if>

${(cate.categoryName)!}

</option>

<#assigncount=category_index+1>

</#list>

</select>

</td>

<td>

<fontcolor="red">*</font>品类:<inputtype="text"id="categoryNames${category_index+1}"name="categoryNames"value="${(category.categoryName)!}"readonly="readonly">

标签名:<inputtype="text"id="tagNames${category_index+1}"name="tagNames"value="${(category.prodTagName)!}"readonly="readonly">

<scripttype="text/javascript"src="${base}/js/jquery-1.4.2.min.js"></script>

<script>

varid="${count}";

varidd="${category.categoryId}";

$.ajax({

type:"post",

url:"/product/getProdTagByCategoryId.action",

data:"category.id="+idd,

success:function(msg){

$("#tagNames"+id).val(msg);

}

});

</script>

</td>

</tr>

</#list>

</tbody>

</table>

相关推荐