Problem/Motivation

I have an Number input field - which requires user to enter 1 or greater. If the user enters a 0, the error message reads 'must be greater than 1' which is technically incorrect.
I also set the minimum value to '2" and entered a 1 in the input field. It said 'Must be greater than 2'.

Steps to reproduce

Create a webform, add an element of Number. in the element settings, set the minimum value to 1. Run the form and enter a 0.

Proposed resolution

I believe the message should read 'Must be greater than 0 '. I think the code should be a formula of '[minimum value]-1' to resolve correctly.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jshimota01 created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new4.66 KB

I am not sure where your error message is being generated from.

Do you have the clientside validation module enabled?

Did you set a custom error message?

The attached webform generates the below messages,

Clientside validation module: The value in {Element title} has to be greater than 1.

Serversite (Drupal) validation: {Element title} must be higher than or equal to 1.

jshimota01’s picture

You are scary - good. I disabled clientside validation - and as you point out, the message changed.
Just to be clear, the message you stated for 'Serverside Drupal" wasn't exactly as you said - but it was not erroneous :).
it said 'Please select a value that is no less than 1'.

I'm sorry I didn't realize this was coming from another module. I"ll repost it there. I'm grateful for your time.

jshimota01’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)