# How to restrict negative values in tags

**URL:** <https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [May 4, 2024, 4:43am UTC](https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917 "2024-05-04T04:43:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [May 4, 2024, 4:43am UTC](https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917/1 "2024-05-04T04:43:31Z")

</div>

Hi ,

How to restrict negative values in tags ? Even if user enter negative value ,how to change that as positive value , is there any datatype which accepts only positive values

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 4, 2024, 8:14am UTC](https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917/2 "2024-05-04T08:14:17Z")

</div>

Use the Numeric Entry Field component and set  
`inputBounds.minimum : 0`  
`inputBounds.invalidStyle.borderStyle : solid`  
`inputBounds.invalidStyle.borderColor : --error`  
`inputBounds.invalidStyle.borderWidth : 2`

If you like that then define a style for your error, e.g., "numericError", (and use `var(--error)` for the color in a style class). Then delete the direct style definitions on the component and set  
`inputBounds.invalidStyle.classes : numericError`

Do that on all your numeric entry fields and you can control the style consistently and easily in one place.

> **[Perspective - Numeric Entry Field | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-input-palette/perspective-numeric-entry-field)**
>
> The Numeric Entry Field is similar to the standard Text Field, except that it is specialized for use with numbers.

> **[Perspective Built-In Themes | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/styles/perspective-built-in-themes)**
>
> Themes

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [May 4, 2024, 11:27am UTC](https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917/3 "2024-05-04T11:27:55Z")

</div>

In the tag configuration, does it work if you set the EngLow value? (I know it work on read, but not sure on write.)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 4, 2024, 11:46am UTC](https://forum.inductiveautomation.com/t/how-to-restrict-negative-values-in-tags/89917/4 "2024-05-04T11:46:38Z")

</div>

> [@calimero100582](#):
>
> ... set the EngLow value?

A quick test in Designer shows that it does the job but generates an error message.

![Out of range](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/2/d2ff862491c7625bff36e5b8d6b199582b7c3889.png)

You need to decide a balance between obtrusive and obvious! You probably don't want the operator to think a value has been accepted and have Ignition quietly change it back to the previous value because of an out-of-range input error.
