谢谢苏哥,如果你看到,就留个言吧,哈哈
一般的disabled元素是禁用表单元素,该元素的值,Struts1的form是获取不到的,
而select没有readOnly属性,所以怎样做才能使Struts1的form获取到disabled元素呢?
[color=blue]1 使用上面介绍的一种方法[/color]
[color=darkblue]2 js控制表单的提交,在表单提交之前将 disabled属性置为可用,提交之后置回去[/color]。
例子
<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" onfocus="this.blur();">
<select ><option selected >aaa</option><option>bbb</option></select>
</span>
一般的disabled元素是禁用表单元素,该元素的值,Struts1的form是获取不到的,
而select没有readOnly属性,所以怎样做才能使Struts1的form获取到disabled元素呢?
[color=blue]1 使用上面介绍的一种方法[/color]
[color=darkblue]2 js控制表单的提交,在表单提交之前将 disabled属性置为可用,提交之后置回去[/color]。
例子
var selectElementAttr = $('#selectEle).attr("disabled");
$('#selectEle).attr("disabled","");// 可用
document.getElementById("form1").target = "aaa";
document.form1.action="";
document.form1.submit();
$('#selectEle).attr("disabled",selectElementAttr);//置回去