如何更改复选框的背景颜色选中复选框... [英] how to change checkbox's background color whene checkbox is checked...

查看:215
本文介绍了如何更改复选框的背景颜色选中复选框...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生......



我的要求来自用户点击复选框列表复选框,这些复选框的背景颜色已更改.....

这些是我的代码 -

公共字符串getWhileLoopData1()

{

List< int> list = new List< int>();

OleDbConnection cn = con.GetConnection();

string s2 =select_,seat_id from available_seat where screen_no =+ Lbl_screen_no.Text +和seat_class ='黄金'按ID排序;

cmd1 =新OleDbCommand(s2,cn);

OleDbDataReader dr1 = cmd1.ExecuteReader();

if(dr1.HasRows)

{

while(dr1.Read())

{

int count = Convert.ToInt32(dr1 [0]);

list.Add(count);

}

}

string htmlStr =;

for(int i = 0; i< list.Count;)

{

htmlStr + =< input type ='复选框'Id =+ list [i] +name =''value =''>< input type ='复选框'Id =+ list [i + 1] +      < input type ='checkbox'Id =+ list [i + 2] +< input type ='checkbox'Id =+ list [i + 3] +< input type ='checkbox' Id =+ list [i + 4] +< input type ='checkbox'Id =+ list [i + 5] +< input type ='checkbox'Id =+ list [i + 6] +< input type ='checkbox'Id =+ list [i + 7] +     < input type ='checkbox'Id =+ list [i + 8] +< input type ='checkbox'Id =+ list [i + 9] +;

Dear Sir...

My requirement is from list of checkboxes whene user click on checkbox the background color of these checkbox is changed.....
These is my code-
public string getWhileLoopData1()
{
List<int> list = new List<int>();
OleDbConnection cn = con.GetConnection();
string s2 = "Select id,seat_id from available_seat Where screen_no="+Lbl_screen_no.Text+" and seat_class='Gold' order by id";
cmd1 = new OleDbCommand(s2, cn);
OleDbDataReader dr1 = cmd1.ExecuteReader();
if (dr1.HasRows)
{
while (dr1.Read())
{
int count = Convert.ToInt32(dr1[0]);
list.Add(count);
}
}
string htmlStr = "";
for (int i = 0; i < list.Count; )
{
htmlStr += "<input type='checkbox' Id=" + list[i] + " name=' ' value=' '><input type='checkbox' Id=" + list[i + 1] + "     <input type='checkbox' Id=" + list[i + 2] + "<input type='checkbox' Id=" + list[i + 3] + "<input type='checkbox' Id=" + list[i + 4] + "<input type='checkbox' Id=" + list[i + 5] + "<input type='checkbox' Id=" + list[i + 6] + "<input type='checkbox' Id=" + list[i + 7] + "     <input type='checkbox' Id=" + list[i + 8] + "<input type='checkbox' Id=" + list[i + 9] + "";

i = i + 10;
       }
       return htmlStr;
   }









plz help ....





plz help....

推荐答案

参考



javascript-to-change-check-box-background-color-on-click.aspx [ ^ ]


这篇关于如何更改复选框的背景颜色选中复选框...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆