1

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");
        }
    }
});

})

pvzkch
  • 341
  • 2
  • 4
  • 18

1 Answers1

3

Just use usePreview: false as an parameter in the keyboard

See this edited fiddle

Umang Mehta
  • 1,467
  • 11
  • 16
  • Do accept the answer if that helps you to solve your question. – Umang Mehta May 13 '14 at 06:38
  • Thanks! That actually helped. Another question, why is it always focusing on the first input field? Try this one, while focused on the second input field, click anywhere on the jQueryUI Dialog and it will focus back on first input field. – pvzkch May 13 '14 at 07:43