How do I lock a textbox's cursor at the end of its text

Get help using Construct 2

Post » Mon Oct 17, 2016 12:54 pm

Hi everyone,

I'm using a textbox to allow the player to enter its name, and I need the cursor to be always at the end (right) of the text contained.
To make it perfectly clear, I want that when the player press the left arrow, nothing happens. I don't want the cursor to move left.

I tried with Textbox > "scroll to bottom", but it didn't help.

Is there any way to achieve this?
Thanks!
B
29
S
6
G
1
Posts: 347
Reputation: 2,725

Post » Mon Oct 17, 2016 2:35 pm

Image
B
65
S
23
G
7
Posts: 1,504
Reputation: 10,894

Post » Mon Oct 17, 2016 2:50 pm

@korbaach

Thanks a lot! I conclude from your capx that it is not possible inside Construct 2, but is possible with Javascript?
Il'll copy paste your javascript code in my project.

Thanks again, really helpful! :)
B
29
S
6
G
1
Posts: 347
Reputation: 2,725

Post » Mon Oct 17, 2016 3:09 pm

just pay attention..
if you use javascript &
Code: Select all
document.getElementById('input')

you need to set optional ID
Image
Image
B
65
S
23
G
7
Posts: 1,504
Reputation: 10,894

Post » Mon Oct 17, 2016 8:19 pm

Thanks to your last comment, it now works perfectly. Thanks a lot, sir! :)
B
29
S
6
G
1
Posts: 347
Reputation: 2,725


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu and 6 guests