Question

I have a little problem on using Mottie's jQuery OSK(On Screen Keyboard) on dialog boxes. You might want to check this link to make it simpler.

When selecting the second input field on a jQuery dialog, it always jumps on the first input field.

Here are the codes I used:

HTML:

<div id='dialog' title='This is a title' style='display: none'>
<h3>I just want to say something</h3>
<label>Say something: </label><br />
<input type='text' id='SaySomething' /><br /><br />

<label>Enter another text: </label><br />
<input type='text' id='SaySomething2' /><br /><br /></div><button>Click me</button><br /><label>Say something: </label><br /><input type='text' id='SaySomethingOutside' /><br /><label>Enter another text: </label><br /><input type='text' id='SaySomethingOutside2' /><br />

JavaScript:

$(function(){
$("button").click(function(){
    $("#dialog").dialog("open");
}).button();
$("input").keyboard();
$("#dialog").dialog({
    modal: true,
    autoOpen: false,
    buttons : {
        OK: function(){
            $(this).dialog("close");
        }
    }
});

})

Was it helpful?

Solution

Just use usePreview: false as an parameter in the keyboard

See this edited fiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top