如果data = 1中的值,如何以编程方式检查复选框 [英] How to programmatically check a checkbox if value in database = 1

查看:70
本文介绍了如果data = 1中的值,如何以编程方式检查复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑下表



名称价值

aaa 1

bbb 0

ccc 1

现在我正试图通过我的网页生成报告(html表格)。当报告加载时,我希望它显示3复选框,并且应自动检查数据库中值为1的复选框。例如 -



aaa check

bbb未选中

ccc check



我尝试了什么:



i尝试插入复选框列表,但不检查框而不是打印对于包含1的列,则为true。

解决方案

正如注释中所指出的,调试代码,您将看到LOGO_SCREEN!=1。

Consider the following table

Name value
aaa 1
bbb 0
ccc 1
Now I am trying to generate a report(html form) through my web page. When the report loads I want it to show 3 checkbox and the ones with value "1" in the database should be automatically checked. For eg-

aaa checked
bbb unchecked
ccc checked

What I have tried:

i tried to insert checkbox list but that does not check the box instead it prints true for the column that has 1.

解决方案

As pointed out in comments, debug the code and you'll see that LOGO_SCREEN != "1".


这篇关于如果data = 1中的值,如何以编程方式检查复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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