-
Notifications
You must be signed in to change notification settings - Fork 725
Closed
Description
Hi,
Is there a way to change a key (or action key) text dynamically? What I'm trying to do is to change the key text of {next] button to 'Submit' when last input box is in focus.
Here is my js code:
$.keyboard.keyaction.next = function (base) {
var parent_fieldset = $('#' + base.el.name).parents('fieldset');
var $prevInput = $('#' + parent_fieldset.attr("id") + ' input:eq(-2)');
//If 2nd to the last input is in focus
if ($prevInput.attr("id") == base.el.name) {
setTimeout(function () {
var keyboard = $('.keyboard-normal').keyboard().getkeyboard();
keyboard.options.display.next = 'Submit';
//keyboard.redraw();
$('.ui-keyboard-next').find("span:contains('Go')").text('Submit');
}, 500);
}
base.switchInput(true, base.options.autoAccept);
return false;
};
It seems to work but when my mouse exited the button the text reverts back to 'Next'.
Thank you in advance.