input mask to enter IP addresses

G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top