web-project 故障修复功能 传递所有的event_id数据到后台

 <script language=javascript>
function IdentifyRepair(event_id)
{
var url;
url = "/View/faultyinfo?event_id=" + event_id;
window.location.href = url;
} 9 function GetEventId()
10 {
11 var evid_list = document.getElementsByName("evid_list");
12 var evid_info = "";
13 for(var j=0; j<evid_list.length; j++){
14 evid_info += evid_list[j].value + " ";
15 }
16
17 var url;
18 url = "/View/faultyinfo?event_id=" + evid_info;
19 window.location.href = url;
20 }
</script> <body> <table class=title width=700>
<tr>
<td><b>故障信息</b></td>
<td style="font-size:12px;color:#185A73" align=right width=*>{% module Uptime() %}</td>
</tr>
</table> <br>
{% if lists != [] %}
<input type="button" onclick="GetEventId()" value="repair all">
{% end %}
<br>
{% for d in lists %}
<table width=900 border=0 cellspacing=1 cellpadding=1>
<tr id=tblhdr height=22>
<td width=200 align=center>TIME</td>
<td width=300 align=center>EVENT_ID</td>
<td width=150 align=center>MSG_ID</td>
<td width=150 align=center>SEVERITY</td>
<td align=center>
{% if d['event_id'] %}
<a style="color:#0000ff"
href="javascript:IdentifyRepair('{{d['event_id']}}')">修复</a>
{% end %}
</td>
</tr> <tr id=row1>
<td align=center>{{ d['time'] }}</td>
<td align=center>{{ d['event_id'] }}</td>
<td align=center>{{ d['msg_id'] }}</td>
<td align=center>{{ d['severity'] }}</td>
57 <input name="evid_list" type="hidden" value={{ d['event_id'] }} /> </tr>

通过 57 行代码,每次执行该行代码将 event_id 存放到 input name="evid_list" 中

通过 34 行代码,点击button按钮,执行JS代码 GetEventId() ,将所有的event_id存放到变量 evid_info 中,最后传递到后台

上一篇:Oracle Study之--OEM登录错误


下一篇:.NET判断是否为AJAX提交