Default behavior of dialog() and <input>

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Posts: 619
Joined: Wed Aug 29, 2007 1:18 am

Default behavior of dialog() and <input>

Post by Veggiesama »

I've been reading [wiki]Introduction to Dialogs and Frames[/wiki].

I'm switching from using [wfunc]input[/wfunc] to using [wfunc]dialog[/wfunc], and I'm missing some behaviors that input() had. Maybe someone who knows more about HTML can help me get them back, and if not, consider them feature requests. =P

1. With input(), when you tab or click on a textbox, all of the text is automatically highlighted. With HTML <input type="text">, the cursor is placed where you click and nothing is highlighted. I like auto-highlight more.

2. With input(), the focus automatically starts on the first textbox. With <input> forms, I can't seem to get that to happen, even if I set a tabindex (which doesn't seem to do anything in MapTool dialogs).

3. With input(), if I open a window and immediately press enter, it is executed. With the dialog, pressing enter does nothing until I focus on a textbox (it doesn't even do anything if I focus on the submit button). This probably has something to do with #2.

4. With input(), a cancel button appears next to the OK button. Unfortunately I cannot get <button> to work with the form, and I don't like the default placement of the "Close" button (it's impossible to make it in-line with the Submit button), so I turn it off with input="1".
My D&D 4e Campaign FrameworkMy Shadowrun 4e Campaign Framework
RPGA#: 5223846427 — Skype: Veggiesama — Fear the ferret.

User avatar
Cave Troll
Posts: 40
Joined: Sun Jan 05, 2014 9:28 am

Re: Default behavior of dialog() and <input>

Post by Clyde »

Hello everyone!

I am having the exact same problem, and it is annoying.

You cannot adapt the "input()" method to the mood of the game (backgroundcolor and the likes), hence i would like to use "dialog()".
But using "input()" you get quick responsive dialogues, while using "dialog()" i cannot set the curser to the most commonly changed field, so that you usually (like with "input()") would just have to type a number and hit enter.

Since the original Post is old, is there a solution now?

If not, i would like to ask for the html code of autofocus="autofocus" and tabindex="" to be implemented.

With kind regards,

Post Reply

Return to “Macros”