input mask to enter IP addresses

H

Harry

I have a form where I am entering in a customer's IP address as part of their
info. I would like something more customized than 999.999.999.999 for the
input mask. I would like to be able to enter 4 sets of numbers between zero
and 255. with a period between each set. Perhaps, after typing in the first
set, hit the space bar to create the period and move you to the next typing
space. Could someone help me figure out how to create the code for this (or
something like it)?
 
A

Allen Browne

How about 4 fields of type Number, size Byte?

You can interface them with 4 text boxes on your form, put dots in their
labels, and use the events to achieve whatever behavior you desire.

Essentially, an IP address does consist of 4 bytes, so this seems to be the
most logical approach, and makes it child's play to handle A- or B-level
domains, etc.
 
Top