Data Validation - MAC Address

Hello,

I have an app where my installers will need to enter the MAC address for a device they are installing. I am looking for assistance in validating that the data entered is a valid MAC address.

The MAC field they are using is setup as a text type.

MAC address must contain exactly 12 characters, where each character is equal to 0-9 or a-f.

Additional characters may be entered as separators, eg aa.00.bbโ€ฆ or 00:de:9aโ€ฆ.

What I would like to have happen is this:

  1. User enters data
  2. System looks at characters and extracts valid characters up to 12 leftmost found.
    3a. If 12 valid characters, system reformats the data to be aa:bb:ccโ€ฆ dropping any invalid characters and performing a ToLower() on the alpha characters.
    3b. If cannot find 12 valid characters, then an error is generated and the data entered is removed.

TIA for any assistance you may be able to provide.

PS - Secondary question: is there any way to get a UPC or QR code reader data to be entered directly into the app in order to optimize data collection?

Solved Solved
0 15 974
1 ACCEPTED SOLUTION

15 REPLIES 15
Top Labels in this Space