I have a webview in which user has to type their email and password in the corresponding input fields. I want to show the email friendly keyboard when the user taps on the email field. How to do it using javascript ?
I tried using the javascript by using the following code
String emailKeyboard="document.getElementById('src').type=\"email\";";
mWebView.loadUrl("javascript:(function() { " + emailKeyboard +"})()");
also i tried by getting the element by name as
String emailKeyboard="document.getElementByName('j_username').type=\"email\";";
mWebView.loadUrl("javascript:(function() { " + emailKeyboard +"})()");
where j_username is the name of the input field. But it is not working. Any help greatly appreciated.
Thanks, Senthil.M
Why not just set the type of the fields directly in the HTML rather than trying to add them on the fly (which causes more strain on performance anyway...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With