Skip to content

[JENKINS-76002] String comparison in JS when numbers are expected #16802

@jenkins-infra-bot

Description

@jenkins-infra-bot

compares min and max, which are strings.

"5" would be greater than "10" here, because they're compared by character, not numeric value.

To reproduce, compare form validation behavior of e.g.

<f:number min="10" max="20" clazz="positive-number-required" />

and

<f:number min="5" max="10" clazz="positive-number-required" /> 

 


Originally reported by danielbeck, imported from: String comparison in JS when numbers are expected
  • assignee: jpochat
  • status: Closed
  • priority: Minor
  • component(s): core
  • label(s): 2.528.1-fixed, ux
  • resolution: Fixed
  • resolved: 2025-09-23T01:48:41+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

compares min and max, which are strings.

"5" would be greater than "10" here, because they're compared by character, not numeric value.

To reproduce, compare form validation behavior of e.g.

<f:number min="10" max="20" clazz="positive-number-required" />

and

<f:number min="5" max="10" clazz="positive-number-required" /> 

 

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions