Fodo Docs
Forms

Number Field

Numeric input with validation and formatting

Number Field

The number field accepts numeric values with optional validation for range, decimals, and step values.

When to use

  • Quantities (order amounts, attendees)
  • Ages
  • Prices and amounts
  • Ratings and scores
  • Any numeric input

Settings

Label

Example: "Quantity", "Age", "Budget"

Placeholder

Example: "0", "Enter amount"

Description

Help text or format guidance.

Required

Make this field mandatory.

Default value

Pre-filled number.

Validation

Minimum value

Lowest allowed number.

SettingExample Use
0Quantities (no negatives)
1Required positive number
18Age verification

Maximum value

Highest allowed number.

SettingExample Use
100Percentages
999Limited quantities
10000Budget caps

Step

Increment value. Controls what numbers are valid.

StepValid Values
1Whole numbers only (default)
0.01Currency (two decimals)
0.5Half increments
10Tens only (10, 20, 30...)

Decimal places

Display format for the value:

SettingDisplay
042
142.0
242.00

Display options

Prefix

Text or symbol before the input:

Prefix: $
Display: $ [____]

Suffix

Text or symbol after the input:

Suffix: kg
Display: [____] kg

Spinner controls

Show increment/decrement buttons:

[ - ] 5 [ + ]

Useful for quantity selectors.

Examples

Quantity selector

Label: Quantity
Required: Yes
Min Value: 1
Max Value: 99
Step: 1
Default Value: 1
Spinner: Yes

Price/Budget

Label: Budget
Placeholder: 0.00
Required: Yes
Min Value: 0
Step: 0.01
Prefix: $
Decimal Places: 2

Age

Label: Age
Required: Yes
Min Value: 18
Max Value: 120
Step: 1
Description: You must be at least 18 years old.

Rating (1-10)

Label: Rate your experience
Required: Yes
Min Value: 1
Max Value: 10
Step: 1
Spinner: Yes
Description: 1 = Poor, 10 = Excellent

Percentage

Label: Discount Percentage
Required: No
Min Value: 0
Max Value: 100
Step: 1
Suffix: %

Mobile experience

Number fields show a numeric keyboard on mobile devices, making input faster and reducing errors.

Styling

<div class="fodo-field fodo-field-number">
  <label class="fodo-label" for="field_abc123">
    Quantity
    <span class="fodo-required">*</span>
  </label>
  <div class="fodo-input-wrapper">
    <span class="fodo-prefix">$</span>
    <input
      type="number"
      id="field_abc123"
      name="fields[abc123]"
      class="fodo-input fodo-input-number"
      min="0"
      max="10000"
      step="0.01"
      required
    >
  </div>
</div>

Hide spinner arrows

/* Chrome, Safari, Edge */
.fodo-input-number::-webkit-outer-spin-button,
.fodo-input-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.fodo-input-number {
  -moz-appearance: textfield;
}