1、 我的问题:
我在一个form表单中, 有“批量删除”,“批量审核通过”,“批量拒绝下单”三个submit, 我在服务器端想通过判断判断每次提交的submit上的值后再分别做处理? 如我得到的是“批量删除”我就做删除操作....
当然对每个submit提交写一个对应的方法是可以实现的, 我就想写在一个方法中, 请问struts中可以办到不?
^_^ ^_^ 解决了, 方法如下:
<script>
function formSubmit(value){
//document.forms[0].action.value = "i love you ";
document.getElementById("btnName").value=value;
//alert("hidden:"+document.getElementById("btnName").value);
document.forms[0].submit();
}
</script>
<INPUT id=btnName type=hidden
name="btnName"> <INPUT class=button id=button1 type=button value="批量审核通过" name="btn1" onclick="formSubmit('pass')">
<INPUT class=button id=button2 type=button value="批量拒绝下单" name="" onclick="formSubmit('refuse')" >
<INPUT class=button id=button3 type=button value="批量删除" name="" onclick="formSubmit('delete')">
然后在command中接收到的hidden中的值进行判断分别处理。
——————另种思路:
id="all"
document.getElementById('all').onclick=function() {
var checked = $('all').checked;
var el = document.getElementsByTagName('input');
each(el,function(e){
if(e.type=='checkbox' && e.getAttribute('name')=='list') {
e.checked = checked;
}
});
}
<input type="checkbox" name="" value="1"/>
2、 今天在启动oracle10g时出现了如下错误: ORACLE TNS-12542:TNS 地址已被占用
网上搜多到的一些解决方案:
使用 regedit 命令,修改注册表:
1. HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ Services/TCPIP/Parameters 注册表子键并创建名为 TcpTimedWaitDelay 的新 REG_DWORD 值。 将此值设置为十进制 30,其为十六进制 0x0000001e。该值将等待时间设置为 30 秒。
缺省值:0xF0,它将等待时间设置为 240 秒(4 分钟)。建议值:最小值为 0x1E,它将等待时间设置为 30 秒。
2. HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ Services/TCPIP/Parameters 注册表子键并创建名为 MaxUserPort 的新 REG_DWORD 值。 缺省值:无 建议值:至少十进制 32768。 注:当在 Windows NT 或 Windows 2000 操作系统上调整 WebSphere Application Server 时。
完成后重启机器。
当在 Windows NT 或 Windows 2000 操作系统上调整 WebSphere Application Server 时,同时使用这两个参数.
相关文章参考: http://support.microsoft.com/kb/328476/zh-cn
3、 如何在鼠标移动到某一表格行的上面时改变其背景颜色:
.datatable tr:hover, datatable tr.hilite{
background-color: #DFE7E2
color: #000000;
}
<script >
//用于控制表格行的高亮显示
var rows = document.getElementsByTagName('tr');
for(var i=0; i<rows.length;i++){
rows[i].onmouseover = function(){this.className += ' hilite'}
rows[i].onmouseout = function(){this.className=this.className.replace('hilite','')};
}
</script>
4、 如何使点击过的超链接变色?
我比较喜欢浏览网页,有时候打开一个页面,里面的超链接很多,点着点着自己都不知道点过哪些超链接,也不知道看过哪些网页了.
有什么办法能让我知道自己已经点过哪些超链接吗?比如那些我点过的超链接会自动变色,让人更醒目.
————解决方式: a、 浏览器工具菜单》internet选项》常规》颜色,自己定义一下就可以了。
b、 通过后台传值改变颜色: 定义超连接的样式
a:link {color: #000; text-decoration:none;}
a:visited {color: #000;text-decoration:none;}
a:hover {color: #bc2931; text-decoration:underline;}
a:active {color: #000;}