Skip to content
Sections
Fiesta

field-money

Form The fields a person types into, in the states a real form puts them in. Each one sits in a padded rst-box, because that is the card a form goes in.

A money amount in one currency. The currency code shows beside the label and is sent with the form, so a currency that changed while someone was typing is caught on save.

Each example is live, but its links go nowhere. HTML shows the markup to copy.

Bare

Preview

Put this inside <section rst-box><form rst-form>.

<div rst-field>
  <label rst-field-label for="fm_bare">Ticket price <span class="rst-mono">EUR</span></label>
  <input rst-input id="fm_bare" name="fm_bare" type="text" inputmode="decimal">
  <input type="hidden" name="fm_bare.locale" value="en">
  <input type="hidden" name="fm_bare.currency" value="EUR">
  <input type="hidden" name="fm_bare.seed" value="">
</div>

With a hint

Preview

Put this inside <section rst-box><form rst-form>.

<div rst-field>
  <label rst-field-label for="fm_hint">Ticket price <span class="rst-mono">EUR</span></label>
  <input rst-input id="fm_hint" name="fm_hint" type="text" inputmode="decimal" aria-describedby="fm_hint-hint">
  <input type="hidden" name="fm_hint.locale" value="en">
  <input type="hidden" name="fm_hint.currency" value="EUR">
  <input type="hidden" name="fm_hint.seed" value="">
  <small rst-field-hint id="fm_hint-hint">For example, 12.50 or €12.50.</small>
</div>

With an error

Preview

Put this inside <section rst-box><form rst-form>.

<div rst-field>
  <label rst-field-label for="fm_error">Ticket price <span class="rst-mono">EUR</span></label>
  <input rst-input id="fm_error" name="fm_error" type="text" inputmode="decimal" value="12,.50" aria-invalid="true" aria-describedby="fm_error-error">
  <input type="hidden" name="fm_error.locale" value="en">
  <input type="hidden" name="fm_error.currency" value="EUR">
  <input type="hidden" name="fm_error.seed" value="">
  <small rst-field-error id="fm_error-error">Use a point for decimals, like 12.50.</small>
</div>