日期:2014-05-16  浏览次数:20450 次

新手请教:关于jquery对表格的操作
我有一个表格,
如何通过Jquery点击表格中的“完成”小图标,
1.执行ajax在数据库中更改订单状态,
2.并使本行中“订单状态”的内容改为“完成”?


附图1:



附表格代码:(表格ID="tab")

<table  width="80%" border="0" align="center" cellspacing="1" class="xqcd" style="border:1px solid #09C;" id="tab">
<form name="form1">
  <tr style="background-image:url(image/c1.jpg)">
    <th height="40"><font color="#FFFFFF" size="3">订单编号</font></th>
    <th><font color="#FFFFFF" size="3">订单状态</font></th>
    <th><font color="#FFFFFF" size="3">客户姓名</font></th>
    <th><font color="#FFFFFF" size="3">联系电话</font></th>
    <th><font color="#FFFFFF" size="3">来电号码</font></th>
    <th><font color="#FFFFFF" size="3">来电时间</font></th>
    <th><font color="#FFFFFF" size="3">配送人</font></th>
    <th><font color="#FFFFFF" size="3">转派</font></th>
    <th><font color="#FFFFFF" size="3">配送电话</font></th>
    <th><font color="#FFFFFF" size="3">详情</font></th>
    <th><font color="#FFFFFF" size="3">催办</font></th>
    <th><font color="#FFFFFF" size="3">完成</font></th>
    </tr>
    
<?    
$SQL = "select a.* from script a";
$query=mysql_query($SQL);
while($rs = mysql_fetch_array($query)){    
?>
  <tr bgcolor="">
    <td height="40" align="center"><span id="hold_stockCode"><?=$rs[script_id]?></span></td>
    <td align="center"><span id="wei"><?=$rs[wei]?></span></td>
    <td align="center"><?=$rs[call_name]?></td>
    <td><?=$rs[call_tel]?></td>
    <td><?=$rs[call_number]?></td>
    <td><?=$rs[stime]?></td>
    <td><?=$rs[salesman]?></td>
    <td><a href="#"><img src="image/xiugai.png" width="36" height="38" border="0" /></a></td>
    <td><?=$rs[sales_tel]?></td>
    <td><a href="#"><img src="image/12O264103920-1D6339.gif" width="24" height="24" border="0" /></a></td>
    <td><a href="#"><img src="image/duanxin.png" width="36" height="38" border="0" /></a></td>
    <td><a href="#" class="wancheng"><img src="image/wancheng.png" width="36" height="38" border="0" /></a></td>
    &l