在struts中如何用radio去控制按钮的可用性?
是不是需要写函数?
<html:radio propert="name" onlick=enable()>之类的。
我想一进入页面,最上面的按钮就是选中的,相关的按钮(比方说submit按钮,然后跳到新的画面me2)如果我选中,按钮就可用,如果不选中,按钮就不能用,新画面就弹不出来。
是不是需要写函数?
<html:radio propert="name" onlick=enable()>之类的。
我想一进入页面,最上面的按钮就是选中的,相关的按钮(比方说submit按钮,然后跳到新的画面me2)如果我选中,按钮就可用,如果不选中,按钮就不能用,新画面就弹不出来。
<input type="radio" name="aa" value=2 onclick="enable()">can submit
<input type="submit" name="sub">
<script>
function enable()
{
sub.disabled=true;
for (var i=0; i<aa.length; i++)
{
if (aa[i].checked && aa[i].value==2)
{
sub.disabled=false;
break;
}
}
}
aa[1].checked=true;
enable();
</script>