在焦点problam的复选框与TextBox [英] Check Box with TextBox on focus problam
本文介绍了在焦点problam的复选框与TextBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用我的代码后面的文本框填充复选框列表,但问题是当我选中复选框然后单击文本框进行编写时,复选框将取消选中,因此有任何解决方案,我可以保留复选框选中并且写在文本框中?
以下是我的代码
i am trying to populate checkbox list with textbox from my code behind but the problem is when i check the checkbox and then click on textbox to write , the checkbox gets unchecked so is there any solution by which i can retain checkbox checked and write in textbox?
following is my code in
foreach (DataRow drowwardtype in dswardtype.Tables[0].Rows)
{
CheckBoxList1.Items.Add(new ListItem(
string.Format("<label>" + drowwardtype["DataTypeDesc"].ToString() + "</label> <input style=''width:25px;'' type=''text'' name=''" + "txt" + drowwardtype["DataTypeDesc"].ToString() + "''> ")));
}
推荐答案
你可以通过Javascript,
来实现它,但要填充复选框html
Hi,
You can achive it by Javascript,
but to populate Check box html
<input id="[id]" type="check" onchange="your funtion to set text box enable or disable">></input>
这篇关于在焦点problam的复选框与TextBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文