Contentful logo

Contentful Community

Displaying dropdown of numbers with validation set as range from min = 1 max = 24


Hello All,

We want to display dropdown of numbers for a field which has range as validation e.g min=1 max=24

Requirement is to display dropdown with default set to 1 and options available from 1 to 24

Below is snippet from model definition…

.name("Some Field Name")
    range: {
      min: 1,
      max: 24

Can any one please suggest how can I display drop down in this case ?

Is it mandatory to set validation as “IN” instead of range and add individual number 1 to 24 to achieve a dropdown ?

Faizaan Shaikh