in reply to Re: CGI - input number fields
in thread CGI - input number fields

I could understand *that* reasoning for a text field, but the number field? They have a specified range of 0 through 5 (and show "no selection" on the initial form display) so to my way of thinking, as the user hasn't even selected the field, no value has even been selected.

Replies are listed 'Best First'.
Re^3: CGI - input number fields
by choroba (Cardinal) on Sep 07, 2017 at 21:28 UTC
    What do you mean by a "number field"? I don't remember anything like that from HTML4.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Input type of "number" - as per HTML5. see example below
      <INPUT MAX="5" MIN="0" NAME="K0030" TYPE="number">

        I would assume that this is merely a hint to the browser to show you a numeric keyboard.

        The standard says that the empty string is a valid value. So the user agent ("browser") will send it always.