Welcome! Log In Create A New Profile

Advanced

IP mask

Posted by Piet van Zanten 
Piet van Zanten
IP mask
September 23, 2008 07:08PM
Hi,

Anybody got an input mask for ip numbers?

Regards,
Piet
Alexandre Leclerc
Re: IP mask
September 23, 2008 09:43PM
Hi Piet,

MatchRegularExpression has an all made example in the wizard. (If this is what you meant in your question.)

[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}

Regards.
Piet van Zanten
Re: IP mask
September 23, 2008 10:46PM
Hi Alexandre,

Thank you for the suggestion. I now have matchregularexpression working fine, but I cannot get the inputmask working. I use:
Myself..InputMask="regexp:[0-9.]{4,15}"
as suggested in the help.
With this mask no characters can be typed at all.

Best regards,
Piet
Alexandre Leclerc
Re: IP mask
September 24, 2008 03:23PM
Hi Piet,

This is because you require a minimum of 4 caracters and when you start you have none. So the input is wrong. You "must" accept a mask with 0 caracters, or at least provide a starting value which is valid.

The InputMask is not good at validating, but is like a guide to help the user input data as required. This is an on going process.

Best regards.
Fabrice Harari.pcs.crosspost
Re: IP mask
September 24, 2008 03:42PM
Hi Piet...

if I remember correctly my regular expression, yours allow string
between 4 and 15 long.... So when you type your first number, the string
is only ONE long, and is incorrect

What I do generally in thos case is to put as mask something quite
permissive (by example here it would be[0-9.]{1,15}) and then check in
the field exit code with a precise expression if the result is ok (by
the way, Alexandre gave you a much more precise expression that you can use)

Best regards

--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

Plus d'information sur [fabriceharari.com]


Piet van Zanten wrote:
> Hi Alexandre,
> Thank you for the suggestion. I now have matchregularexpression working fine, but I cannot get the inputmask working. I use:
> Myself..InputMask="regexp:[0-9.]{4,15}"
> as suggested in the help.
> With this mask no characters can be typed at all.
> Best regards,
> Piet
>
>
Message forwarded from pcsoft.us.windev
Piet van Zanten
Re: IP mask
September 24, 2008 09:24PM
Thanks guys, again I learned something, it works now as expected.
Best regards,
Piet
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: