zoukankan      html  css  js  c++  java
  • html checkbox

    <fieldset>
    <legend>where do you live?</legend>
    <input type="checkbox" id="arearural" name="areatypes[]" value="rural"/>
    <label for="arearural">Rural </label>
    <input type="checkbox" id="areasuburb" name="areatype[]" value="suburb"/>
    <label for="areasuburb">Suburb</label>
    <input type="checkbox" id="areacity" name="areatypes[]" value="city"/>
    <label for="areacity">City </label>
    </fieldset>

       Here the name attribute for all the checkmarks is the same and has square brackets prefi xed to it.The square brackets tell the system to send the checked values as an array. If you leave off the square   brackets, only the last checked value is sent. You could also have each name be different and without   the square brackets. In that case each name that was selected is sent as a separate value. With checkboxes,  only checked values are sent.

    name数组以数组的形式发送选择的值,如果省略方括号,仅仅只有最后一个选择的值被发送。

    You can also have individual checkboxes that are not part of a group. In the following instance,

    if the box is checked, the form fi eld imagesonly is sent with the value of yes. If it is not checked,
    nothing is sent:
    <input type=”checkbox” id=”imagesonly” name=”imagesonly” value=”yes” />
    <label for=”imagesonly”> Check here if you only want images.</label>

  • 相关阅读:
    9.3 simulated match
    网络流模版大全
    Treblecross
    ENimEN
    求逆序对的两种方法(树状数组/归并排序)
    树状数组
    计算最短路和次短路条数
    Python3.7版库的安装以及常用方法(十分简单)
    二维线段树(hdu1823)
    流星雨(记忆化搜索)
  • 原文地址:https://www.cnblogs.com/youxin/p/2329422.html
Copyright © 2011-2022 走看看