ID:182176
 
I have a browser pop-up in a game, and in the page within it I want to have a text area that allows the user to use tab for indenting rather than changing focus to the next control on the page. Does anyone know if this is possible?

I'm concerned that it's not because I find no answers with Google; but then again, I don't even find similar questions being posed, so maybe I'm just not using the right search terms.

Thanks
The only way I can think of would be using javascript to capture the key press event of the tab key and then appending the required characters to the input element. That is, if it even lets you capture the tab key press.
Thanks both of you.

I didn't bother trying to search for a javascript solution at first because I just assumed it would be more work than I wanted, so I was looking for an html solution. Adding javascript did indeed provide the easy solution after all! My bad.

The following page ended up having the perfect javascript code snippet to plug in to get it to work in Byond's browser popups.

http://aspalliance.com/346

By the way, Byond's browser popups are still IE-based only, aren't they? I remember a long time ago people asking if they could change the default it used, but I didn't think that had been done yet. If it has, I'll have to add more to make it multi-browser.
In response to Loduwijk
Loduwijk wrote:
By the way, Byond's browser popups are still IE-based only, aren't they? I remember a long time ago people asking if they could change the default it used, but I didn't think that had been done yet. If it has, I'll have to add more to make it multi-browser.

Yep, still IE-only.

Also, did you notice the comment on that page suggesting that event.srcElement.focus(); is added to return focus to the textarea?

It would be kind of neat to get this functionality on the BYOND forums, for when you find yourself writing code on the spot and don't feel like copying a tab from somewhere else. I bet it could be done with Greasemonkey!