Millisecond Forums

restrict integer

https://forums.millisecond.com/Topic26799.aspx

By S.Weber - 4/14/2019

Hello,
I´m a really beginner and I need some help, please.

How can I create an expression with an restricted input from an integer from 01001 to 99998? These are our possible ZIP-Codes, therefore I need the zero in the beginning and the limitation to 5 digits.
Can somebody help, please?
Thank you!

By Dave - 4/14/2019

S.Weber - Monday, April 15, 2019
Hello,
I´m a really beginner and I need some help, please.

How can I create an expression with an restricted input from an integer from 01001 to 99998? These are our possible ZIP-Codes, therefore I need the zero in the beginning and the limitation to 5 digits.
Can somebody help, please?
Thank you!


If you are using a <textbox> or <openended> to collect the ZIP-code, you should not need any expression. You should be able to use the /mask attribute set to uszipcode

https://www.millisecond.com/support/docs/v4/html/language/attributes/mask.htm

Alternatively, you can tailor a regular expression to your needs (see e.g. https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s14.html) and put that in the /mask attribute.

By S.Weber - 4/14/2019

Dave - Monday, April 15, 2019
S.Weber - Monday, April 15, 2019
Hello,
I´m a really beginner and I need some help, please.

How can I create an expression with an restricted input from an integer from 01001 to 99998? These are our possible ZIP-Codes, therefore I need the zero in the beginning and the limitation to 5 digits.
Can somebody help, please?
Thank you!


If you are using a <textbox> or <openended> to collect the ZIP-code, you should not need any expression. You should be able to use the /mask attribute set to uszipcode

https://www.millisecond.com/support/docs/v4/html/language/attributes/mask.htm

Alternatively, you can tailor a regular expression to your needs (see e.g. https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s14.html) and put that in the /mask attribute.


Perfect! Thank you!