+5 html input forms...">

Are you allowed to have input without a value?

Is the following allowed?

<input type="hidden" name="field" />
+5
source share
3 answers

It is perfect in hidden areas. This is only required for flags and radio inputs. It can never be specified using file input. See http://www.w3schools.com/TAGS/att_input_value.asp

+9
source

scheme XHTML 1.1 says that valueis not mandatory:

 <xs:attributeGroup name="xhtml.input.attlist">
    <xs:attributeGroup ref="xhtml.Common.attrib"/>
    <xs:attribute name="type" type="xhtml.InputType.class" default="text"/>    
    <xs:attribute name="name" type="xh11d:CDATA"/>
    <xs:attribute name="value" type="xh11d:CDATA"/>
    <xs:attribute name="checked">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="checked"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="size" type="xh11d:Number"/>
    <xs:attribute name="maxlength" type="xh11d:Number"/>
    <xs:attribute name="src" type="xh11d:URI"/>
    <xs:attribute name="tabindex" type="xh11d:Number"/>    
    <xs:attribute name="accesskey" type="xh11d:Character"/>
  </xs:attributeGroup>
+5
source

, , xhtml.

, .

+3

All Articles