1963
Views
8
Comments
Setting maxlength for number datatype.
Question

Hi all, How to apply maxlength for number datatype in mobile application.

2018-12-13 07-53-54
Alam

Ellakkiya Selvadurai wrote:

Hi all, How to apply maxlength for number datatype in mobile application.You 

You can follow this link...
https://www.outsystems.com/forums/discussion/27816/mobile-max-length-of-input-not-working/

UserImage.jpg
Ellakkiya

Khandakar Tareq wrote:

Ellakkiya Selvadurai wrote:

Hi all, How to apply maxlength for number datatype in mobile application.You 

You can follow this link...
https://www.outsystems.com/forums/discussion/27816/mobile-max-length-of-input-not-working/

Thankyou for your reply, but I need more clarification.....




2020-02-28 09-46-54
Eduardo Jauch

Please.

Explain what you are trying to achieve.

Cheers.

UserImage.jpg
Ellakkiya

Eduardo Jauch wrote:

Please.

Explain what you are trying to achieve.

Cheers.


I am trying to set the max length for an input widget which has the datatype as number...

2020-02-28 09-46-54
Eduardo Jauch

In the attributes section you can add the max and min attributes, that will define the minimum and maximum VALUE you can enter, or, as usually is best, you validate your variable before trying to use it, and warn the user if the value he entered is invalid.

If you are entering only simple integers and really want to limit the number of digits the user enters, you can set the input to Tel and it will allow you to set the maxLenght property.

Other than that only through JavaScript.

Cheers.

UserImage.jpg
Ellakkiya

Eduardo Jauch wrote:

In the attributes section you can add the max and min attributes, that will define the minimum and maximum VALUE you can enter, or, as usually is best, you validate your variable before trying to use it, and warn the user if the value he entered is invalid.

If you are entering only simple integers and really want to limit the number of digits the user enters, you can set the input to Tel and it will allow you to set the maxLenght property.

Other than that only through JavaScript.

Cheers.

Thankyou for your reply


UserImage.jpg
Ellakkiya

Eduardo Jauch wrote:

In the attributes section you can add the max and min attributes, that will define the minimum and maximum VALUE you can enter, or, as usually is best, you validate your variable before trying to use it, and warn the user if the value he entered is invalid.

If you are entering only simple integers and really want to limit the number of digits the user enters, you can set the input to Tel and it will allow you to set the maxLenght property.

Other than that only through JavaScript.

Cheers.


Thankyou for your reply.,

How it can be achieved through Javascript. I have used the Javascript on onready function.

2020-02-28 09-46-54
Eduardo Jauch

You have to capture the key pressed (and the way for doing this may be different depending on the device) and check if the length of the string is at the limit and just ignore the key pressed.

Please, take a look at this discussion.

https://www.outsystems.com/forums/discussion/33623/javascript-to-detect-enter-key-press-in-mobile-app/

Cheers.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.