客户端CheckBox按照选择的顺序进行排序
2009-11-08 00:49
381 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>丁学-博问demo</title> </head> <body> <form id="form1" runat="server"> <table id="tableSn"> <tr> <td><asp:CheckBox ID="ckbCarType" runat="server" Text="机型" onclick="chk(this)" /></td> <td><asp:TextBox ID="txtCarType" runat="server" Width="20px"></asp:TextBox></td> <td><asp:CheckBox ID="ckbGood" runat="server" Text="零件号" onclick="chk(this)" /></td> <td style="width: 20px"><asp:TextBox ID="txtGood" runat="server" Width="20px"></asp:TextBox></td> </tr> <tr> <td><asp:CheckBox ID="ckbLine" runat="server" Text="品别" onclick="chk(this)" /></td> <td><asp:TextBox ID="txtLine" runat="server" Width="20px"></asp:TextBox></td> <td><asp:CheckBox ID="ckbClass" runat="server" Text="班别" onclick="chk(this)" /></td> <td style="width: 20px"><asp:TextBox ID="txtClass" runat="server" Width="20px"></asp:TextBox></td> </tr> <tr> <td><asp:CheckBox ID="ckbUnContent" runat="server" Text="不良说明" onclick="chk(this)" /></td> <td><asp:TextBox ID="txtUnContent" runat="server" Width="20px"></asp:TextBox></td> <td><asp:CheckBox ID="ckbMachine" runat="server" Text="机器号" onclick="chk(this)" /></td> <td style="width: 20px"><asp:TextBox ID="txtMachine" runat="server" Width="20px"></asp:TextBox></td> </tr> <tr> <td><asp:CheckBox ID="ckbUnPlace" runat="server" Text="不良点" onclick="chk(this)" /></td> <td><asp:TextBox ID="txtUnplace" runat="server" Width="20px"></asp:TextBox></td> <td><asp:CheckBox ID="ckbPartItem" runat="server" Text="成品名" onclick="chk(this)" /></td> <td style="width: 20px"><asp:TextBox ID="txtPartItem" runat="server" Width="20px"></asp:TextBox></td> </tr> <tr> <td><asp:CheckBox ID="ckbManagePoint" runat="server" Text="部位名" onclick="chk(this)" /></td> <td><asp:TextBox ID="txtManagePoint" runat="server" Width="20px"></asp:TextBox></td> <td></td> <td style="width: 20px"></td> </tr> <tr> <td colspan="2"><asp:CheckBox ID="ckbUnDate" runat="server" Text="发生日" onclick="chk(this)" /></td> <td colspan="2"> <asp:TextBox ID="txtUnDate" runat="server" Width="20px"></asp:TextBox> <asp:DropDownList ID="dpdDateSquence" runat="server"> <asp:ListItem>按月</asp:ListItem> <asp:ListItem>按日</asp:ListItem> </asp:DropDownList> </td> </tr> <tr> <td colspan="2"><asp:CheckBox ID="ckbUnReason" runat="server" Text="不合格原因" onclick="chk(this)" /></td> <td colspan="2"> <asp:TextBox ID="txtUnReason" runat="server" Width="20px"></asp:TextBox> <asp:DropDownList ID="dpdProject" runat="server"></asp:DropDownList> </td> </tr> </table> <mce:script type="text/javascript"><!-- // 丁学, Ding Xue, http://www.cnblogs.com/DingXue var checkedIds = ""; //记录被选中的ID们 function chk(obj){ if(obj.checked==true) checkedIds += obj.id + ","; else{ document.getElementById(obj.id.replace("ckb","txt")).value=""; checkedIds = checkedIds.replace(obj.id+",",""); } var item = checkedIds.split(','); for(var i=0;i<item.length-1;i++) document.getElementById(item[i].replace("ckb","txt")).value=i+1; } // --></mce:script> </form> </body> </html>
相关文章推荐
- 如何实现在客户端,使CheckBox按照选择的顺序进行排序--来自博问的问题
- PHP 多维数组按照指定的顺序进行排序
- SQL按照一定顺序进行排序
- SqlServer按照指定顺序对字段进行排序
- 产生10个1-100的随机整数, * 把其中的奇数按照从小到大的顺序进行排序, * 并按照“1,2,3,、、、”这样的格式打印到d盘下的number.txt文档中。
- SqlServer按照指定顺序对字段进行排序
- SQL 语句中按照in语句原有的顺序进行排序
- sql按照in中的顺序进行排序 mysql
- java 给定一个字符串数组。按照字典顺序进行从小到大的排序。
- 把字符串按照特定的字母顺序进行排序的js代码
- 把字符串按照特定的字母顺序进行排序的js代码
- 已知一个几乎有序的数组,几乎有序是指,如果把数组排好顺序的话,每个元素移动的距离可以不超过k,并且k相对于数组来说比较小。请选择一个合适的排序算法针对这个数据进行排序。 给定一个int数组A,同时给定
- 转:从键盘输入一个字符串,按照字符顺序从小到大进行排序,并要求删除重复的的字符。
- 使用Word对段落按照字母顺序进行排序
- SqlServer按照指定顺序对字段进行排序
- 按照 in (....) 里面的顺序进行排序
- sql 按照任意顺序进行排序
- 对字符串按照从小到大的顺序进行排序
- dataGridView 的columnType设为DataGridViewCheckBoxColumn,当选择其他列进行排序时,DataGridViewCheckBoxColumn列值被还原
- SQL 语句中按照in语句原有的顺序进行排序