首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CGI >

怎么将8个同名的CHECKBOX,值是0或1,提交后保存到一个8位的整型下,并且刷新见面后要能根据0或1判断是否选中

2012-12-19 
如何将8个同名的CHECKBOX,值是0或1,提交后保存到一个8位的整型上,并且刷新见面后要能根据0或1判断是否选中

如何将8个同名的CHECKBOX,值是0或1,提交后保存到一个8位的整型上,并且刷新见面后要能根据0或1判断是否选中
   printf(" <form id="frmTS23_16" name="frmTS23_16" method="post" action="slotConfig.cgi?chassis_idx=%d&slot_idx=%d" target="actPro">\n", p_map.ChassisIndex, SlotIndex); 

          if(p_map.SlotTS23_16&00000001==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS16 </span>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS16 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&00000010==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS17 </span>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS17 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&00000100==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS18 </span>\n"); 
            } 
          else 


            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS18 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&00001000==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS19 </span> <br>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS19 </span> <br>\n"); 
            } 

          if(p_map.TS23_16&00010000==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS20 </span>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS20 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&00100000==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS21 </span>\n"); 


            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS21 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&01000000==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS22 </span>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS22 </span>\n"); 
            } 

          if(p_map.SlotTS23_16&10000000==0) 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="0" />\n"); 
              printf("            <span class="style6">TS23 </span>\n"); 
            } 
          else 
            { 
              printf("  <input name="TS23_16" id="TS23_16" type="checkbox" value="1" checked="checked" />\n"); 
              printf("            <span class="style6">TS23 </span>\n"); 
            } 

  printf(" <input name="subTS23_16" type="submit" id="subTS23_16" value="设置"> <br> </from>\n"); 

[解决办法]
没人哟。。。不过俺 已经自己解决问题了。。。。。。。。


[解决办法]
问题已解决。。。。。。。。。。。。。。。

热点排行