
# Limit input characters

With the editor's ignoreCharacters and inputCharacters properties, you can set only specific characters to be input, or restrict certain characters from being input.

```js
const fields = [
  { fieldName: "OrderID", dataType: "text" },
  { fieldName: "CustomerID", dataType: "text" },
  { fieldName: "EmployeeID", dataType: "text" },
  { fieldName: "Quantity", dataType: "number" },
  { fieldName: "OrderDate", dataType: "datetime" },
  { fieldName: "CompanyName", dataType: "text" },
  { fieldName: "Country", dataType: "text" },
  { fieldName: "Phone", dataType: "text" },
  { fieldName: "ProductName", dataType: "text" },
  { fieldName: "QuantityPerUnit", dataType: "text" },
  { fieldName: "UnitPrice", dataType: "number" }
];

const columns = [
  {
    name: "OrderID",
    fieldName: "OrderID",
    width: "150",
    header: { text: "Only alphabets allowed" },
    editor: { type: "line", inputCharacters: "A-Za-z" }
  },
  {
    name: "CustomerID",
    fieldName: "CustomerID",
    width: "150",
    header: { text: "Alphabets not allowed" },
    editor: { type: "line", ignoreCharacters: "A-Za-z" }
  },
  {
    name: "Quantity",
    fieldName: "Quantity",
    width: "150",
    header: { text: "Alphabets not allowed" },
    editor: { type: "number", inputCharacters: "0-9" }
  },
  {
    name: "EmployeeID",
    fieldName: "EmployeeID",
    header: { text: "Only Korean allowed" },
    editor: { type: "line", inputCharacters: "ㄱ-힣" }
  }
];

const { gridView, dataProvider } = RealGrid.createGrid("realgrid", {
  columns,
  header: { height: 40 },
  display: { rowHeight: 36, emptyMessage: "No data to display." },
  footer: { height: 40 },
  stateBar: { width: 16 },
  onInitialized: (grid) => {
    const datas = [
      ["VINET","10248","Korean Input", 1],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"],
      ["VINET","10248","Korean Input"]
    ];
    grid.getDataSource().setRows(datas);
  }
}, {
  fields
});

window.gridView = gridView;
window.dataProvider = dataProvider;
```

#### Only specific characters can be entered

Characters applied to the editor.inputCharacters property can be input when editing grid cells.

```js
{
     "name": "OrderID",
     "fieldName": "OrderID",
     "width": "150",
     "header": {
         "text": "Only alphabet input is allowed"
     },
     "editor": {
         "type": "line",
         "inputCharacters": "A-Za-z"
     }
}
```

#### Restrict input of specific characters


Characters applied to the editor.ignoreCharacters property cannot be entered when editing grid cells.

```js
{
     "name": "CustomerID",
     "fieldName": "CustomerID",
     "width": "150",
     "header": {
         "text": "Alphabet cannot be entered"
     },
     "editor": {
         "type": "line",
         "ignoreCharacters": "A-Za-z"
     }
}
```

#### Only Korean characters can be entered

You can use inputCharacters to set it so that only Korean characters can be input.

```js
{
     "name": "EmployeeID",
     "fieldName": "EmployeeID",
     "width": "150",
     "header": {
         "text": "Only Korean characters can be entered"
     },
     "editor": {
         "type": "line",
         "inputCharacters": "ㄱ-힣"
     }
}
```