I am using the following code to allow the user to enter data using an Input dialog from XUI Views.
How can I "force" a ten digit number - only ten - no more, no less
Only after the tenth digit is entered, does the "OK" become enabled.
I have tried:
This somewhat works, but the user can enter in excess of ten digits.
My Code:
How can I "force" a ten digit number - only ten - no more, no less
Only after the tenth digit is entered, does the "OK" become enabled.
I have tried:
B4X:
input.RegexPattern = ".........." 'require at least one character
My Code:
B4X:
Dim input As B4XInputTemplate
dialog.Initialize(Activity)
dialog.Title = "Lead Guru"
input.Initialize
input.lblTitle.Text = "Enter your phone number:"
input.ConfigureForNumbers(True, True)
input.RegexPattern = ".+" 'require at least one character
Wait For (dialog.ShowTemplate(input, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
LogColor("Pressed Dialog OK", Colors.Magenta)
End If