Number Field

1 minute read


The number field extends the textfield and formats it based on the type.

Input Parameters

Name Type Description
className string The class name to apply to the main element.
el HTMLElement The element to render the number to.
decimals number The number of decimals allowed.
description string The field description
maxValue number The maximum value allowed.
minValue number The minimum value allowed.
onChange (value: string) The change event
placeholder string The placeholder text.
type number The textfield type.
value string The textfield value.

Number Field Interface

Name Type/Description
get() Returns the fabric component.
getValue() Returns the textfield value.
setErrorMessage(message: string) Sets the error message.
setValue(value: string) Sets the textfield value.


var $REST = require("gd-sprest-js");

// Create the 
var el = document.querySelector("#number");
    el: el,
    label: "My Number:",
    minValue: -100,
    maxValue: 100


import { Fabric } from "gd-sprest-js";

// Create the 
let el = document.querySelector("#number");
    label: "My Number:",
    minValue: -100,
    maxValue: 100