Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions core/src/main/resources/lib/form/number.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ THE SOFTWARE.
</st:attribute>
<st:attribute name="min"> <![CDATA[
The minimum of the @value. This becomes the @min of the <input> tag.
This will work only @clazz is 'number', 'number-required', 'non-negative-number-required',
This will work only if @clazz is 'number', 'number-required', 'non-negative-number-required',
'positive-number', 'positive-number-required'.
If specified, the @value should be greater than this value, or errors will be rendered under the text field.
If this value contains non-digit characters, it will not work.
Expand All @@ -57,13 +57,19 @@ THE SOFTWARE.
</st:attribute>
<st:attribute name="max"> <![CDATA[
The maximum of the @value. This becomes the @max of the <input> tag.
This will work only @clazz is 'number', 'number-required', 'non-negative-number-required',
This will work only if @clazz is 'number', 'number-required', 'non-negative-number-required',
'positive-number', 'positive-number-required'.
If specified, the @value should be less than this value, or errors will be rendered under the text field.
If this value contains non-digit characters, it will not work.
If @min is specified and @min is greater than this value, both @min and @max will not work.
]]>
</st:attribute>
<st:attribute name="step">
The step size of the @value. The default is 1.
This will work only if @clazz is 'number', 'number-required', 'non-negative-number-required',
'positive-number', 'positive-number-required'.
Copy link
Member

@daniel-beck daniel-beck Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would that be the case? min and max are specifically supported by registerMinMaxValidator. step is only used by the browser's basic number spinner control. Nothing in Jenkins that I could find cares about this parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As step is passed to the input (as are min and max due to the morphtag) it would also be possible to use 0.1 for step (might not make sense to use non integer step values it in most places). But with a 0.1 step setting the validator would not work anymore as it expect integers.
But the step can definitely be used without any of the classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would also be possible to use 0.1 for step (might not make sense to use non integer step values it in most places).

This would contradict the below line, stating

If this value contains non-digit characters, it will not work.

Although it's unclear what would "not work", as there's nothing in Jenkins supporting this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using any of the number classes then the step should be an integer. Otherwise the spinner of the input would change the field to non integer values.
But without the number classes a step of 0.1 works fine

If this value contains non-digit characters, it will not work.
</st:attribute>
<!-- Tomcat doesn't like us using the attribute called 'class' -->
<st:attribute name="clazz">
Additional CSS class(es) to add (such as client-side validation clazz="required",
Expand Down
Loading