delphi WebBroker and CheckBox  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi WebBroker and CheckBox


delphi WebBroker and CheckBox



以下页面,提交到 WebBroker 的时候,在WebBroker 对应路径 CK 下的 Delphi 代码,可以读到:

<form action="CK" method="post">



    <input type="checkbox" name="CK1" Value="1">跑步

<p></p>

    <input type="checkbox" name="CK2" Value="2">游泳

<p></p>

    <input type="checkbox" name="CK3" Value="3">爬山

<p></p>

    <input type="checkbox" name="CK4" Value="4">打球

    <p></p>

     <input type="submit" value="提交">

</form>



--------- 代码 -------

for I := 0 to Request.ContentFields.Count -1 do

  begin

    S := S + '; ' + Request.ContentFields.Values[Request.ContentFields.Names[i]];

  end;



这里,页面上有 4  个 CheckBox,但 Request.ContentFields.Count 只包括用户勾选了的项目。

因此,如果仅仅是读 Request.ContentFields.Names[i],就能读到勾选了的 CheckBox 的 name,没勾选的不会读到;


————————————————


原文链接:https://blog.csdn.net/pcplayer/article/details/69230165



推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.037834882736206 seconds