Iframe 包含HTML中复选框列表的可滚动框

Iframe 包含HTML中复选框列表的可滚动框,iframe,html,checkbox,scrollable,Iframe,Html,Checkbox,Scrollable,附件中,您将看到我为所需UI制作的模型的图片。正如你所看到的,我需要一些包含复选框的可滚动框 我想到了一个可滚动的div,尽管我找不到在div周围设置边框的方法?第二,我想到了一个IFrame。。但也不太确定这是否是我的最佳选择 有没有人有更简单/更好的方法 提前谢谢 CSS: .container { border:2px solid #ccc; width:300px; height: 100px; overflow-y: scroll; } HTML: 外观: 这就是您要寻找的吗?如果您

附件中,您将看到我为所需UI制作的模型的图片。正如你所看到的,我需要一些包含复选框的可滚动框

我想到了一个可滚动的div,尽管我找不到在div周围设置边框的方法?第二,我想到了一个IFrame。。但也不太确定这是否是我的最佳选择

有没有人有更简单/更好的方法

提前谢谢

CSS:

.container { border:2px solid #ccc; width:300px; height: 100px; overflow-y: scroll; }
HTML:

外观:


这就是您要寻找的吗?

如果您有权限,请在PHP中使用此函数

        function addOCheckBoxValuesByArray($arr) {      
                foreach ($arr as $key => $value) {
                echo"<input type= 'checkbox' name='formBylist[]' value='$value' />$value<br />";
                }

        }



    below code access data after user press submit button

    if(isset($_POST['formBylist']))
        {   
            $selectedDataBylist = $_POST['formBylist'];
            if(!isset($selectedDataBylist))
            {  // is data not selected
                echo "You didn't select data from below checkbox Table";
            }
            else
            { // data is user selected
                $Cnt = count($selectedDataBylist);

                for($i=0; $i < $Cnt; $i++)
                {           
                $result =$selectedDataBylist[$i]);

                    }
    }
    enter code here

}



to put all check boxes in scroll bar - use CSS 

<html lang="en">
<head>
<style>
.container { border:2px solid #ccc; width:400px; height: 500px; overflow-y: scroll; } 
</style>
</head>



///
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">         
                <div class="container">             
                                   addOCheckBoxValuesByArray($chekboxarray);?>
                </div>




    enter code here
一种变体:

函数obtenerselectionados{ var selectionados=[]; $'。上下文或输入:已选中。每个函数{ selectionados.push$this.attr'id'; }; 警惕性; } 孔多尔先生{ 边框:1px纯灰; 宽度:200px; 高度:200px; 溢出y:滚动; 位置:固定; 背景:白色; 边缘顶部:2倍; } 希托: Hito 1 Hito 2 希托3 希托4 希托5 希托6号 希托7号 希托8 Hito Implementación final del evento Hito a8 Hito s8 Hito d8 Hito f8 Hito g8 Lorem ipsum dolor sit amet,libero nullam dolor,拍卖人consequat。Risus donec nunc nulla maecenas,位于马蒂斯,临时区。Faucibus velit vitae arcu mauris,sem blandit elementum。松果菊。马来酸前庭 利古拉,利奥·埃尼安,nec级,圣莫比胡斯托的圣母院主修道士,坐像坐像。埃尼姆·莫莱斯蒂、埃尼姆门、多洛·苏西比特·萨吉提斯、多涅克·奥纳雷·埃尼安·阿利奎特·布朗迪特。时差 马萨·奎斯(massa quis)、佩德·帕雷森特·努拉(pede praesent nulla)和埃吉特·塞德(eget sed)是一家高级酒店。帕特·莫里斯·佩伦茨克(Pat mauris pellentesque)是一位伟大的领袖。Nec奥奇,nunc帝国主义者。这是一个不必要的前庭,欧洲的厄洛斯-tempus-morbi-netus,康格-佩伦特斯-维瓦摩斯,泰勒斯 这是一种很好的治疗方法。大前庭,前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭前庭 函数obtenerselectionados{ var selectionados=[]; $'。上下文或输入:已选中。每个函数{ selectionados.push$this.attr'id'; }; 警惕性; } 孔多尔先生{ 边框:1px纯灰; 宽度:200px; 高度:200px; 溢出y:滚动; 位置:固定; 背景:白色; 边缘顶部:2倍; } 希托: Hito 1 Hito 2 希托3 希托4 希托5 希托6号 希托7号 希托8 Hito Implementación final del evento Hito a8 Hito s8 Hito d8 Hito f8 Hito g8 Lorem ipsum dolor sit amet,libero nullam dolor,拍卖人consequat。Risus donec nunc nulla maecenas,位于马蒂斯,临时区。Faucibus velit vitae arcu mauris,sem blandit elementum。松果菊。马来酸前庭 利古拉,利奥·埃尼安,nec级,圣莫比胡斯托的圣母院主修道士,坐像坐像。埃尼姆·莫莱斯蒂、埃尼姆门、多洛·苏西比特·萨吉提斯、多涅克·奥纳雷·埃尼安·阿利奎特·布朗迪特。时差 马萨·奎斯(massa quis)、佩德·帕雷森特·努拉(pede praesent nulla)和埃吉特·塞德(eget sed)是一家高级酒店。帕特·莫里斯·佩伦茨克(Pat mauris pellentesque)是一位伟大的领袖。Nec奥奇,nunc帝国主义者。这是一个不必要的前庭,欧洲的厄洛斯-tempus-morbi-netus,康格-佩伦特斯-维瓦摩斯,泰勒斯 这是一种很好的治疗方法。大前庭是埃尼安的精英,前庭是弗林蒂利亚·艾米特·沃尔帕特的前庭,前庭是毛里斯·苏西比特的前庭。
        function addOCheckBoxValuesByArray($arr) {      
                foreach ($arr as $key => $value) {
                echo"<input type= 'checkbox' name='formBylist[]' value='$value' />$value<br />";
                }

        }



    below code access data after user press submit button

    if(isset($_POST['formBylist']))
        {   
            $selectedDataBylist = $_POST['formBylist'];
            if(!isset($selectedDataBylist))
            {  // is data not selected
                echo "You didn't select data from below checkbox Table";
            }
            else
            { // data is user selected
                $Cnt = count($selectedDataBylist);

                for($i=0; $i < $Cnt; $i++)
                {           
                $result =$selectedDataBylist[$i]);

                    }
    }
    enter code here

}



to put all check boxes in scroll bar - use CSS 

<html lang="en">
<head>
<style>
.container { border:2px solid #ccc; width:400px; height: 500px; overflow-y: scroll; } 
</style>
</head>



///
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">         
                <div class="container">             
                                   addOCheckBoxValuesByArray($chekboxarray);?>
                </div>




    enter code here
<style type="text/css">
   select, ul { height: 100px; overflow: auto; width: 100px; border: 1px solid #000; }
   ul { list-style-type: none; margin: 0; padding: 0; overflow-x: hidden; }
   li { margin: 0; padding: 0; }
   label { display: block; color: WindowText; background-color: Window; margin: 0; padding: 0; width: 100%; }
   label:hover { background-color: Highlight; color: HighlightText; }
  </style>
<ul>
   <li><label for="chk1"><input type="checkbox" name="chk1" id="chk1">First</label></li>
   <li><label for="chk2"><input type="checkbox" name="chk2" id="chk2">Second</label></li>
   <li><label for="chk3"><input type="checkbox" name="chk3" id="chk3">Third</label></li>
   <li><label for="chk4"><input type="checkbox" name="chk4" id="chk4">Fourth</label></li>
   <li><label for="chk5"><input type="checkbox" name="chk5" id="chk5">Fifth</label></li>
   <li><label for="chk6"><input type="checkbox" name="chk6" id="chk6">Sixth</label></li>
   <li><label for="chk7"><input type="checkbox" name="chk7" id="chk7">Seventh</label></li>
  </ul>