读书人

怎么将8个同名的CHECKBOX值是0或1

发布时间: 2012-12-19 14:13:15 作者: rapoo

如何将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");

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


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

读书人网 >CGI

热点推荐