Type number form in textField for plugin I haven't found any fields that deal with numbers for a plugin. I've changed a forms.textField into a type:number which has seemed to work fine for the most part. But I can't find a way to keep someone from going under 0 or over 100. I've looked in vendor\craftcms\cms\src\templates\_includes and have come up empty.

I'm assuming I'll need to make a custom field type for this but if there is something I'd rather not reinvent the wheel.

  {{ forms.textField({
      label: 'Blanket Discount Percent',
      instructions: 'Set this if you want to offer a blanket discount to all businesses. Do not put in letters or decimals. (10 = 10%)',
      id: 'blanketDiscount',
      name: 'settings[blanketDiscount]',
      value: settings.blanketDiscount,
      type: 'number',
   })}}


I do have a rule for validation setup, I would just prefer to keep people in range at the front as well.

['blanketDiscount', 'integer', 'min' =&gt; 0, 'max' =&gt; 100],
Not tested yet.

{{ forms.textField({
        label: 'Number Field',
        id: 'someId',
        name: 'someName',
        value: '',
        min: 0,
        max: 100,
        size: 1,
        type: 'number',
        value: settings['someName']
    })
    }}


I think you can use min and max