Making a textbox lose focus

Get help using Construct 2

Post » Fri May 04, 2012 4:01 pm

Hi there,

I was wondering if there was any way I could make a textbox lose focus. There's an action to make it gain focus but none to lose it. I need it so I can make a chat box like those in rpgs where after typing and entering, the player should be able to use his/her arrow keys to move again.

Thanks,
Dengke
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Post » Fri May 04, 2012 4:25 pm

@Ashley should add this easy option to textbox.
Anyway, you can use calljs plugin.

First, add a textbox and set an ID_textbox in the object's properties.
Then,
[code]When (action)
--> CallJS - Execute "var a=document.getElementById(""ID_textbox""); a.blur();"
[/code]And voila ;)septeven2012-05-04 16:29:34
B
44
S
12
G
13
Posts: 628
Reputation: 10,471

Post » Fri May 04, 2012 4:31 pm

Haha yes, that would be very handy if @Ashley could :D

The calljs plugin looks very handy! Thanks for the work around! :D
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Post » Sat May 05, 2012 5:15 am

@septeven that's a great solution, one that didn't even cross my mind, though I've toiled with CallJS. Thanks for that!

And yep, I'd love to be able to easily get the focus back to the canvas.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Sun Aug 19, 2012 7:45 am

Is this still the only way to remove a focus from a textbox?
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Wed Dec 26, 2012 1:33 am

Thanx @septeven

The loose focus option was exactly what i was looking for.
It makes my app more user friendly!
B
56
S
20
G
13
Posts: 778
Reputation: 13,204


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests