PDA

View Full Version : Input Mask (IP Address)


tkroeckel
03-16-2006, 08:26 AM
Hi,

I'm trying to create with the action:

IPAddress = Dialog.MaskedInput("IP-Adresse WebServer", "Bitte IP-Adresse des WebServers eingeben:", "IP-\Adresse\: ###\.###\.###\.###", "", MB_ICONQUESTION, " ");

to get an valid string from the user.
But the result in the edit field is:
"IP- dresse: , , , "

I'm located in Germany. Are system settings responsible for the missing 'A' and the substitution from '.' to ',' ?:huh

Any help is appreciated and thx in advance.
Thomas

tkroeckel
03-16-2006, 08:44 AM
Hi,
sorry, I solved the display problem - just use "\\" inside a string (mea culpa).

But I have an additional question:

How can I provide the correct number of digits in case not all 3 values in an ip-address are filled:
no problem with : 192.168.123.453, but
how to handle: 192.168.0.21 :huh

Again: Any help is appreciated

Regards
Thomas

dwayne12
08-06-2006, 10:36 PM
That IP you're seeing isn't the true IP address. I have yet to work out how to retrieve the correct ip.

pww
08-07-2006, 06:55 AM
there are 3 ways that I see
- don't use a masked input, use normal one and later validate it
- put a placeholder only for the last digit, like
00#\.00#\.00#\.00#
- or use ###\.###\.###\.### and just inform the user that four 3-digit groups are required and missing digits should be filled with 0's so numbers like 21 should be entered as 021.

In any case you should validate the input because even ###\.###\.###\.### does not guarantee a valid entry - it will accept something like 500.500.500.500. As the masked input can't gurantee a valid input and you should validate it in any case, better use non-masked