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
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Mon Oct 17, 2016 2:35 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

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
32
S
6
G
1
Posts: 353
Reputation: 2,821

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
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Oct 17, 2016 8:19 pm

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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests