Skip to main content
Inspiring
May 6, 2018
Answered

Is it possible to change focus in dialog after input?

  • May 6, 2018
  • 1 reply
  • 1679 views

Is it possible to change focus in dialog window after input?
For instance, after the input changed (there could be any value) the focus should be on the button, so that we could press Enter on the keyboard to submit the dialog.

This topic has been closed for replies.
Correct answer pixxxelschubser

Same procedure as in your other thread

var w = new Window("dialog", "Example Dialog");

w.dialogGroup = w.add("group");

w.dialogGroup.el1 = w.dialogGroup.add("edittext", undefined, "Edit Text 1");

w.dialogGroup.el2 = w.dialogGroup.add("edittext", undefined, "Edit Text 2");

w.dialogGroup.el1.active = true;

w.quitBtn = w.add("button", undefined, "Ok");

w.defaultElement = w.quitBtn;

w.dialogGroup.el1.onChange = function() {

    w.quitBtn.active = true;

    }

w.show();

Have fun

1 reply

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
May 6, 2018

Same procedure as in your other thread

var w = new Window("dialog", "Example Dialog");

w.dialogGroup = w.add("group");

w.dialogGroup.el1 = w.dialogGroup.add("edittext", undefined, "Edit Text 1");

w.dialogGroup.el2 = w.dialogGroup.add("edittext", undefined, "Edit Text 2");

w.dialogGroup.el1.active = true;

w.quitBtn = w.add("button", undefined, "Ok");

w.defaultElement = w.quitBtn;

w.dialogGroup.el1.onChange = function() {

    w.quitBtn.active = true;

    }

w.show();

Have fun

Inspiring
May 6, 2018

But how can I output the value of el1 element?

pixxxelschubser
Community Expert
Community Expert
May 6, 2018

In your snippet.


That's really hard. For me the snippet works as expected (but did only tried from ESTK).

Sometimes Illu scripts make strange things. Maybe try this cumbersome workaround PromptToSaveChanges / ScriptUI Default Highlighted Button