亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何打印所有選中的復選框?

如何打印所有選中的復選框?

PHP
大話西游666 2021-04-04 16:18:31
如果我勾選了多個復選框,我想打印所有在復選框中打勾的值。但是,它只打印我檢查的第一個值。 如果我在此圖像中檢查超過1個復選框 它只從復選框印刷一個值預先感謝 // HTML code    <strong>IT Skills:&emsp;</strong><br><br><div class="checkboxlist"  id="skills">  <input type="checkbox" name="skills" value="Programming/Application Development" class="chk">&nbsp;Programming/Application Development&emsp;  <input type="checkbox" name="skills" value="Project Management" class="chk">&nbsp;Project Management&emsp;<br>  <input type="checkbox" name="skills" value="Helpdesk/Technical Support" class="chk">&nbsp;Helpdesk/ Technical Support&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;  <input type="checkbox" name="skills" value="Security/Compliance Governance" class="chk">&nbsp;Security/ Compliance Governance&emsp;<br>  <input type="checkbox" name="skills" value="Web Development" class="chk">&nbsp;Web Development&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;&nbsp;  <input type="checkbox" name="skills" value="Database Administration" class="chk">&nbsp;Database Administration&emsp;<br>  <input type="checkbox" name="skills" value="Business Intelligence/Analytics" class="chk">&nbsp;Business Intelligence/ Analytics&emsp;&emsp;&emsp;&emsp;&nbsp;  <input type="checkbox" name="skills" value="Mobile Applications and Device Management" class="chk">&nbsp;Mobile Applications and Device Management&emsp;<br>  <input type="checkbox" name="skills" value="Networking" class="chk">&nbsp;Networking&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;  <input type="checkbox" name="skills" value="Big Data" class="chk">&nbsp;Big Data&emsp;<br></div><span class="error_form" id="skills_error_message"></span>
查看完整描述

3 回答

?
呼喚遠方

TA貢獻1856條經驗 獲得超11個贊

我已經找到了問題的答案。事實證明,我需要在每個復選框的名稱中添加[]。因此,當我在技能上添加[]時,它會打印復選框中的所有選中值。順便說一句,感謝所有幫助過我的人。


<strong>IT Skills:&emsp;</strong><br><br>

<div class="checkboxlist"  id="skills">

  <input type="checkbox" name="skills[]" value="Programming/Application Development" class="chk">&nbsp;Programming/Application Development&emsp;

  <input type="checkbox" name="skills[]" value="Project Management" class="chk">&nbsp;Project Management&emsp;<br>

  <input type="checkbox" name="skills[]" value="Helpdesk/Technical Support" class="chk">&nbsp;Helpdesk/ Technical Support&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;

  <input type="checkbox" name="skills[]" value="Security/Compliance Governance" class="chk">&nbsp;Security/ Compliance Governance&emsp;<br>

  <input type="checkbox" name="skills[]" value="Web Development" class="chk">&nbsp;Web Development&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;&nbsp;

  <input type="checkbox" name="skills[]" value="Database Administration" class="chk">&nbsp;Database Administration&emsp;<br>

  <input type="checkbox" name="skills[]" value="Business Intelligence/Analytics" class="chk">&nbsp;Business Intelligence/ Analytics&emsp;&emsp;&emsp;&emsp;&nbsp;

  <input type="checkbox" name="skills[]" value="Mobile Applications and Device Management" class="chk">&nbsp;Mobile Applications and Device Management&emsp;<br>

  <input type="checkbox" name="skills[]" value="Networking" class="chk">&nbsp;Networking&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;

  <input type="checkbox" name="skills[]" value="Big Data" class="chk">&nbsp;Big Data&emsp;<br>

</div>

<span class="error_form" id="skills_error_message"></span>


    [skills] => Array

    (

        [0] => Web Development

        [1] => Business Intelligence/Analytics

        [2] => Networking

    )


查看完整回答
反對 回復 2021-04-23
  • 3 回答
  • 0 關注
  • 339 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號