# IP address data entry / validation ideas?

**URL:** <https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 21, 2025, 9:18pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538 "2025-05-21T21:18:46Z")\
**Posts on this page:** 10\
**Page:** 1

<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 21, 2025, 9:18pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/1 "2025-05-21T21:18:46Z")

</div>

An application I'm working on has a table of assets and one column is the IP address. Has anyone figured out a neat solution for data entry and validation? Presumably I'd have to render the column as a view.

I've played around with 255.255.255.255 using four numeric entry fields with lower and upper limits of 0 and 255. But this accepts decimals (7.3, etc.). Out-of range values can be handled by the `invalidStyle` settings to give a red border, or whatever. It does support the Tab key to move between fields, which is a help.

Any tips?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 21, 2025, 9:21pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/2 "2025-05-21T21:21:31Z")

</div>

~~Formatted text fields using appropriate regex?~~ Not vision, whoops.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [May 21, 2025, 9:30pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/3 "2025-05-21T21:30:56Z")

</div>

How much do you hate your users?

Four 255 entry dropdowns?  
+/- buttons?  
Entry only as hexadecimal?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 21, 2025, 9:32pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/4 "2025-05-21T21:32:38Z")

</div>

> [@David\_Stone](#):
>
> Four 255 entry dropdowns

This reminds me of the 'worst way to enter a phone number' challenge that was on reddit or similar.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [May 21, 2025, 9:34pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/5 "2025-05-21T21:34:22Z")

</div>

Extra marks if the dropdowns are not in numeric order.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 21, 2025, 9:34pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/6 "2025-05-21T21:34:56Z")

</div>

Put them in alphabetical order

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [May 21, 2025, 9:38pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/7 "2025-05-21T21:38:43Z")

</div>

On a more serious note, text field, `deferUpdates` and `rejectUpdatesWhileFocused` off. Value change event that fires on `browser` source only, that applies regex filter to entered value and strips unallowed items (`\D` if using java regex) or enters the max/min value if going beyond edges and writes it back to a custom property on the view. The numeric entry is bound unidirectionally to this custom property.

I think you could also use this script to send focus to the next box on 3rd digit entry.

Might still be racey or loop inducing.

---

<div class="post-metadata">

**Author:** ![Leor\_Fishman](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@Leor\_Fishman](https://forum.inductiveautomation.com/u/Leor_Fishman)\
**Post date:** [May 22, 2025, 3:37am UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/8 "2025-05-22T03:37:30Z")

</div>

put them in order of 'number of pixels in number when written in arial'

almost but not quite numerical order

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 23, 2025, 12:49pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/9 "2025-05-23T12:49:27Z")

</div>

If you're looking for a regex pattern:

```python
import re

def isIPv4(IPString):
	pattern = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
	return len(re.findall(pattern, IPString)) > 0

ipList = ['192.168.1.1',
          '8.8.8.8',
          '10.70.256.3',
          '12.5.68.3.88'
         ]
         
for ip in ipList:
	print '{:19}'.format(ip), isIPv4(ip)

```

Output:

```plaintext
192.168.1.1 True
8.8.8.8 True
10.70.256.3 False
12.5.68.3.88 False
>>> 

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 23, 2025, 1:32pm UTC](https://forum.inductiveautomation.com/t/ip-address-data-entry-validation-ideas/106538/10 "2025-05-23T13:32:03Z")

</div>

> [@JordanCClark](#):
>
> `print '{:19}'`

That's a neat trick.

Java example:

```python
from java.util.regex import Pattern
ipv4 = Pattern.compile( 
	"^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"
)

def isIPv4(ip_string):
	return ipv4.matcher(ip_string).matches()

ipList = [
	'192.168.1.1',
	'8.8.8.8',
	'10.70.256.3',
	'12.5.68.3.88'
]

for ip in ipList:
	print '{:19}'.format(ip), isIPv4(ip)

```

```python
192.168.1.1 True
8.8.8.8 True
10.70.256.3 False
12.5.68.3.88 False

```
