如何在Web窗体中创建动态复选框 [英] How to create Dynamic Check Boxes In Web Form

查看:117
本文介绍了如何在Web窗体中创建动态复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨至!

我正在开发基于web的应用程序,因为有一个Web表单,其中我想要2分区uppper一个包含动态复选框,并且还基于后端(In That有表(ProductMaster,有列CatogoryId))如果catogary是2那么所有产品类型进入上一个,如果是3那么所有产品类型进入前端的下一个。

请帮助我。我很新。

谢谢和问候

Hi To!
I am developing webbased App in that there is web form in which i want 2 Partioning uppper one contain Dynamic Check Boxes and lower on also,based on back-end(In That There is table (ProductMaster,There is Column "CatogoryId")) If catogary is 2 then all "product type" come in Upper one,and if it is 3 then All Product Type Come in Lower one in Front-end.
Please help me am new in it.
Thanks & Regards

推荐答案

从JavaScript试试这个。

你必须得到产品类型清单。运行循环以构建产品类型的html复选框并附加到容器div中。

Try this from JavaScript.
You have to get product type list. Run a loop to build html for product types check boxes and append into container div.
var builder ="";

for (var j = 0; j < product_types.length; j++) {                
     builder = builder + "<input Text='" + product_types[j].Value + "' Value='" + product_types[j].Key + "' id='" + product_types[j].Value+ "' type='checkbox' onclick='FunctionName();' /> " + product_types[j].Value;               
}


#ContainerDiv) .append(建设者);
("#ContainerDiv").append(builder);





谢谢。



Thanks.


这篇关于如何在Web窗体中创建动态复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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