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:
- User enters data
- 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?