Oh, then I misunderstood I guess. I'm not sure I follow the logic then.
If the exact number of required fields is n, doesn't this mean that n
fields must be filled, without excluding the possibility of filling in
other fields? This sounds like a minimum number of fields to me.
OK, I think I understand you, now. However, I don't feel that your idea
of min / max values addresses the presence of the boolean 'required'
attribute that input, select and textarea elements (descendant elements
of the 'fieldset' element) may have.
For example, to take your idea into account, in the case that there are
5 text fields, where none of them have a boolean 'required' attribute,
with a 'minimum' *required* value of two (2) fields set, then at least
two (2) fields would need to be filled in. That I understand.
The new concept of a 'maximum' *required* value that you have
introduced, as I understand, means that the user would be *restricted*
to x number of fields. So with a 'maximum' value set at 4, would that
mean that the user cannot fill in all 5 input text elements? Would one
always be left out, regardless?
What happens if we were now to assign the boolean 'required' attribute
into three (3) of these input text elements? How should user agents
treat these fields? Keep in mind that we have already stated a 'minimum'
of two (2) fields that should be filled in, with the 'minimum'
attribute.
When I first though of my proposal, I did not consider limiting /
restricting available fields. I'm not sure what the real-world scenarios
for limiting fields by a maximum value would be.
Also, I found out just today that 'min' and 'max' attributes already
exist, so we shouldn't simply call them 'min' and 'max' if they were to
be implemented. Perhaps 'minreq' and 'maxreq' would be better names for
these attributes.
http://www.w3.org/TR/html5/forms.html#the-min-and-max-attributes
As to another name for the new 'required' attribute, I could not think
of a better name, other than 'prerequisities', which is a bit long for a
tag; maybe it could be abbreviated to 'prereq'?
There would be a problem with the <select> element, since it can
logically correspond to a set of fields. Just as we often wish to set a
minimum or maximum number of text fields filled in or checkboxes
checked, we may wish to set a minimum or maximum number of options to
be
selected in a <select multiple>. Well, I guess <select> could have min
and max attributes of its own.
Not sure what you mean by problem with the 'select' element; while it is
an element that represents multiple options to choose from, it is an
element in its own right, and could be part of a combination of other
elements of different types, that appear under a 'fieldset' element. In
other words, while multiple items can be selected from a single 'select'
element, the 'select' element itself can also have the required
attribute, and therefore should be taken into consideration alongside
other sibling elements.
Yes, <fieldset> can be used rather freely, but its apparent intended
use
is to group fields that are closely related, like a set of radio
buttons
or a set of <input type=text> elements for a postal address. It has no
functional impact (in HTML as currently defined and implemented).
Hmm, so the 'disabled' attribute isn't something with 'functional
impact'?
http://www.w3.org/TR/html5/forms.html#attr-fieldset-disabled
Thanks again,
- Tristan