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>

  • 相关阅读:
    trie树模型
    计算机网络概念
    [luogu]1042乒乓球 (模拟)
    [IPUOJ10705]最大连通块 (dfs)
    IPUOJ10701 有障碍的八皇后
    【紫书学习笔记】
    纪念正式写博客的第一天
    Bzoj 1997 [Hnoi2010]Planar题解
    Bzoj 1925 [Sdoi2010]地精部落 题解
    Bzoj 2839 集合计数 题解
  • 原文地址:https://www.cnblogs.com/youxin/p/2329422.html
Copyright © 2011-2022 走看看