dongnuo4594 2016-06-22 10:35
浏览 73
已采纳

根据数据库输出在单选按钮上加载具有特定背景颜色的页面

I have a few radio buttons that light up green when page loads. However, I'm creating a "order system" of some sort, and when that specific button or "locker" in my example, I want that specific "locker" to be "locked" (light up red instead of green) when page loads.

I already have the basic set up within my database to echo out "Active" or "Inactive" just to make sure it actually works. But I havent been able to actually modify the radio button based on SQL output.

Any help would be greatly appreciated, if you need more information, I'll upadte.

EDIT: To give it a more visual look, I want the lockers to be red, if the locker has been ordered.

http://prntscr.com/bji7g0

  • 写回答

3条回答 默认 最新

  • duan0513 2016-06-22 10:52
    关注

    I think you just have to make a class in you css called Active for your radios that display Green, and Inactive that display Red. In your html/php just echo the status in the class attribute :

    <input class="<?php  echo $obj['STATUS']; ?>" type="radio" name="my-name" value="1"> Test<br>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?