function resetJs() {
// 从request域中获取原值
var oldName = '<%=((Brand)request.getAttribute("brand")).getName()%>';
var oldImgUrl = '<%=((Brand)request.getAttribute("brand")).getImgUrl()%>';
var oldDescription = '<%=((Brand)request.getAttribute("brand")).getDescription()%>';
var oldSort = '<%=((Brand)request.getAttribute("brand")).getSort()%>';
var oldIsDisplay = '<%=((Brand)request.getAttribute("brand")).getIsDisplay()%>';
// 将原值设置到对应组件中
$("#brandName").val(oldName);
$("#allUrl").val('<%=request.getContextPath()%>'+oldImgUrl);
$("#brandDesc").val(oldDescription);
$("#brandSort").val(oldSort);
if(oldIsDisplay == 0){
$("#radio0").attr("checked","checked");
$("#radio1").attr("checked","");
}
if(oldIsDisplay == 1){
$("#radio0").attr("checked","");
$("#radio1").attr("checked","checked");
}
}
JSP重置按钮。
最新推荐文章于 2022-07-07 11:01:38 发布