B4X FEED Past a string with letters and numbers into Number type TextField

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: Past a string with letters and numbers into Number type TextField است. این موضوع تا کنون 40 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Past a string with letters and numbers into Number type TextField
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
40
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
Hi all - today one of my clients sent me a screenshot with an error message. I tried to reproduce it and found one unexpected result.

Let's say I have a layout with 2 textfields - in my code they are B4XView.

1 - txtProvider
2 - txtProviderName

txtProvider has Keyboard Type - Number_Pad
txtProviderName has Keyboard Type - Default.

I can't type any letters into txtProvider - on a keyboard I see only numbers. Now how to do the trick - type a string like Jane Doe into txtProviderName, copy it and Past it into txtProvider - it works. Then when I click Submit my code crashes because I don't expect any letters in txtProvider (my code assigns a value from txtProvider to the ProviderID variable which is Int).

I tried to do the same trick with the Android version of my app where I have the same 2 EditBoxes - it's impossible to Past a string with letters into txtProvider.

My question is - how to prevent it from happening in the iOS version? I understand that I need to add a validation...



 

عقب
بالا