
Numeric Entry Keypad
Numeric Entry Keypad
I have asked before, and just checking, there is no way to access this type of numeric keypad from SpiderBasic?


Re: Numeric Entry Keypad
Sorry, but there is no pic, so maybe I'm wrong.
But if you want to open a special keypad on a mobile phone when clicking into a StringGadget, on Android a function like this works, if you call it with the ID-number of the StringGadget:
But if you want to open a special keypad on a mobile phone when clicking into a StringGadget, on Android a function like this works, if you call it with the ID-number of the StringGadget:
Code: Select all
Procedure SetStringGadgetKeyboard(id.i, kbdt.u)
If kbdt = 1
! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','decimal');
ElseIf kbdt = 2
! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','numeric');
ElseIf kbdt = 3
! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','email');
Else
! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','text');
EndIf
EndProcedure
Re: Numeric Entry Keypad
Whoa, now that's a cool trick. I'm not OP, but it works here, thanks for sharing!hoerbie wrote: Sat Mar 08, 2025 2:39 pm Sorry, but there is no pic, so maybe I'm wrong.
But if you want to open a special keypad on a mobile phone when clicking into a StringGadget, on Android a function like this works, if you call it with the ID-number of the StringGadget:
Code: Select all
Procedure SetStringGadgetKeyboard(id.i, kbdt.u) If kbdt = 1 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','decimal'); ElseIf kbdt = 2 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','numeric'); ElseIf kbdt = 3 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','email'); Else ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','text'); EndIf EndProcedure
Re: Numeric Entry Keypad
That's amazing thatnk for sharing it. Are there any other input options?hoerbie wrote: Sat Mar 08, 2025 2:39 pm Sorry, but there is no pic, so maybe I'm wrong.
But if you want to open a special keypad on a mobile phone when clicking into a StringGadget, on Android a function like this works, if you call it with the ID-number of the StringGadget:
Code: Select all
Procedure SetStringGadgetKeyboard(id.i, kbdt.u) If kbdt = 1 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','decimal'); ElseIf kbdt = 2 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','numeric'); ElseIf kbdt = 3 ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','email'); Else ! spider_GadgetID(v_id).gadget.textbox.setAttribute('inputmode','text'); EndIf EndProcedure
Re: Numeric Entry Keypad
It's my pleasure to share...
The above was what I needed for my app, but some googling will give more types, for example
https://developer.mozilla.org/en-US/doc ... /inputmode
https://css-tricks.com/everything-you-e ... inputmode/
You will have to find out, what really works with different Android oder iOS versions and their different keypads. I use a lot devices from Sunmi, there are some cheap ones with Android 7.1, there you need to install a software keypad, for example GBoard from Google, to let the input mode work, on more expensive newer one with Android >= 9 the above types work.
The above was what I needed for my app, but some googling will give more types, for example
https://developer.mozilla.org/en-US/doc ... /inputmode
https://css-tricks.com/everything-you-e ... inputmode/
You will have to find out, what really works with different Android oder iOS versions and their different keypads. I use a lot devices from Sunmi, there are some cheap ones with Android 7.1, there you need to install a software keypad, for example GBoard from Google, to let the input mode work, on more expensive newer one with Android >= 9 the above types work.
Re: Numeric Entry Keypad
Absolutely brilliant. Thank you.