Android Question Designer, EditText

ciginfo

Well-Known Member
Licensed User
Longtime User
Hi,
With designer B4A, I want enter dates (DD/MM/ YYYY) into an EditText. What is the ideal "Input Type", TEXT, NONE, NUMBERS, DECIMAL NUMBERS, PHONE?
Thank you.
 
What is the ideal "Input Type", TEXT, NONE, NUMBERS, DECIMAL NUMBERS, PHONE?
Bonjour Monsieur ciginfo:
The ideal way is to use the B4XDateTemplate from the XUI Views lib, but if you simply want to use the keyboard, you can set a SetCustomFilter with the IME lib. like shown below. This will only allow the characters shown, but will not prevent you from typing a bad date, like: 32/14/2020
Code: Copy
Private IME As IME
    IME.Initialize("")
    IME.SetCustomFilter(EditText1, EditText1.INPUT_TYPE_NUMBERS, "0123456789/")
 
Upvote 0
Bonjour Monsieur ciginfo:
The ideal way is to use the B4XDateTemplate from the XUI Views lib, but if you simply want to use the keyboard, you can set a SetCustomFilter with the IME lib. like shown below. This will only allow the characters shown, but will not prevent you from typing a bad date, like: 32/14/2020
Code: Copy
Private IME As IME
    IME.Initialize("")
    IME.SetCustomFilter(EditText1, EditText1.INPUT_TYPE_NUMBERS, "0123456789/")
Thank you
 
Upvote 0
Back
Top