Closed GenijeOnline closed 3 years ago
Hi @GenijeOnline!
Try this code (demo):
$(function() {
$('#keyboard').keyboard({
beforeInsert: function(e, keyboard, el, textToAdd) {
return keyboard.caret().start === 0 && textToAdd.trim() === ''
? ''
: textToAdd;
}
});
});
Yes! That's it.. Thank you Mottie.
Hello. I'm trying to prevent input of blank field but only at begining of text (blank + accept to enter text) and repeated space in text (example: "Text blank blank blank...+accept") on virtual keyboard. My idea is to implement something like this https://stackoverflow.com/questions/48714579/how-do-i-prevent-a-leading-space-from-being-entered-in-a-textbox but for now with no success. It's working on phisical keyboard but not on virtual. Can you please help me with this?