Leaving the field blank should be allowed. The field There should be an "x" mark in the field to cancel inputed value.
User is forced to select an integer from list, or the first in list.
Joomla! 3.9.15
php 7.3
If you have a field of type integer, then an integer is expected.
Right, when the field has a value inside of it. If a field is not marked as a required field, then it should be possible to submit an empty value and it pass validation.
Status | New | ⇒ | Confirmed |
Confirmed this occurs on the Staging branch as well as 4.0dev.
In my opinion this is expected behaviour for a field type="integer".
It is more a feature request, as there are other field types, i.e. "number" or usage of filter="integer" or rule="numeric" or select lists which can be used for a mixed input.
Sorry @chmst but your expected behavior is incorrect. For any supported field type (like the “url”, “tel”, “number”, and “email” inputs in HTML5 or any field type in Joomla which translates to an HTML <select>
element), if the field is NOT marked as a required field, then it MUST be possible to submit an empty field and that submission pass validation. It is bad system design if choosing a field type is forcing a user to enter a value for an optional field to pass some kind of input validation.
So I used it since years in my extensions and did not see it as an issue :). But I understand your point.
Labels |
Added:
No Code Attached Yet
bug
Removed: ? |
Confirmed this occurs on 5.0.0
This issue have 2 parts, a bug and feature request.
The bug:
The integer field has a misleading name, more accurate would be call it "Integers List"
https://docs.joomla.org/Integer_form_field_type :
The integer form field type provides a select box with a range of integer values.
Feature request:
To allow free input of integer/float values it is need to implement a plugin for Number field:
https://docs.joomla.org/Number_form_field_type
This field represent HTML5 <input type="number">
input
Labels |
Added:
Feature
|
Labels |
Removed:
Feature
|
Feature: already exists
Thanks for the note, I did not seen it :)
Seems to me that the Integer field is pretty much unusable on a site that has articles on a variety of topics. It needs fixing!
The bug report is confusingly titled.
The field is not force to be mandatory ie required
However the request is for the field to be saved with a null value. This is not possible because integers represent numeric values and do not inherently include nullability.
If you have a field of type integer, then an integer is expected.
Can ou use a text field or a select list with integers or space or other values?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27877.