Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript PHP for循环生成单选按钮,我只希望从这些按钮中选择一个_Javascript_Php_Html_Css_Radio Button - Fatal编程技术网

Javascript PHP for循环生成单选按钮,我只希望从这些按钮中选择一个

Javascript PHP for循环生成单选按钮,我只希望从这些按钮中选择一个,javascript,php,html,css,radio-button,Javascript,Php,Html,Css,Radio Button,我有这个for循环,我只想从这99个循环中选择一个单选按钮 for($x = 2; $x <= 101; $x++){ $out .= "<img src='/img/channel_icons/".$icons[$x]."' class='channel-icons' title='".$icons[$x]."' alt='".$icons[$x]."' width='20px' height='20px' >";

我有这个for循环,我只想从这99个循环中选择一个单选按钮

            for($x = 2; $x <= 101; $x++){
                $out .= "<img src='/img/channel_icons/".$icons[$x]."' class='channel-icons' title='".$icons[$x]."' alt='".$icons[$x]."' width='20px' height='20px' >";
                $out .= "<input type='radio' value='icon'>";
            }

对于($x=2;$x添加单选按钮的名称以对这些按钮进行分组

for($x = 2; $x <= 101; $x++){
            $out .= "<img src='/img/channel_icons/".$icons[$x]."' class='channel-icons' title='".$icons[$x]."' alt='".$icons[$x]."' width='20px' height='20px' >";
            $out .= "<input type='radio' value='icon' name='sample'>";
        }

对于($x=2;$x添加单选按钮的名称以对这些按钮进行分组

for($x = 2; $x <= 101; $x++){
            $out .= "<img src='/img/channel_icons/".$icons[$x]."' class='channel-icons' title='".$icons[$x]."' alt='".$icons[$x]."' width='20px' height='20px' >";
            $out .= "<input type='radio' value='icon' name='sample'>";
        }

对于($x=2;$x如果你给你的收音机命名,他们应该能够只选择一个,如果使用js,他们应该能够给出唯一的名称,或者id;在这里大声思考(对于js方法)。检查我的解决方案是否对你有用。检查我的答案是否有效如果你给你的收音机命名,他们应该只能选择一个,如果使用js,他们应该能够给出唯一的名称,或者id;在这里大声思考(对于js方法)。检查我的解决方案是否对你有用。检查我的解决方案是否对你有用。检查我的答案是否有效非常好且简单的解决方案。谢谢。非常好且简单的解决方案。谢谢。