NetTalk Central

Author Topic: Nt web server using chrome in Android, how to get rid of the on screen keyboard.  (Read 2287 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Nt web server using chrome in Android.
Im using a barcode scanner, then validate the code and show a message.
The keyboard appears when the codebar entry field is selected. see pic
Then the user cant see the result of the scan.
How to get rid of the mobile keyboard?
Thanks
-----------
Regards
Alberto


Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Thanks bshield,
How do you think about this:

Define an Input element above and append CSS property which will hide the soft keyboard to popping up.
Set Focus to make ready for scanner input in the text field.
The last Step Turn Read-only mode off to input data.

yourInputVal = document.getElementById('myInputElement');
yourInputVal.readOnly = true;
yourInputVal.focus();
setTimeout(function(){
  document.getElementById('myInputElement').readOnly = false;
},

How to test it with NT?
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How if I keep the entry field read-only=true and turn it to false when it gets focus?
How to detect it has focus?
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
No way, cant do it...

Any hint?
-----------
Regards
Alberto

Alberto

  • Hero Member
  • *****
  • Posts: 1846
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Ive made it!

Using this function instead of the Select, I set the field readonly, set focus on it (a readonly field does not activate the keyboard), wait a while for the focus and set it not read only.
I works!
This is the function:

Code: [Select]
function hideKeyboard(element) {
    element.attr('readonly', 'readonly');
    element.focus();
    setTimeout(function() {
         element.focus();
         element.removeAttr('readonly');
    }, 100);
}

And this is how I call it:

Code: [Select]
    p_web.Script('hideKeyboard($("#loc__CodigoEnvio"))')
where loc__CodigoEnvio is my entry field id

Hope it helps someone.


« Last Edit: August 12, 2020, 09:24:04 AM by michelis »
-----------
Regards
Alberto