Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to edit text box after pressing enter?

I am making a game and it uses text boxes, but I want to be able to edit the text boxes after pressing enter/clicking off the text box but I can't, I have looked at the API reference but nothing is mentioning this, please help!

4 comments

0

go to your explorer starter gui then text box then text and change it

0

lemme try

0

didn't work

1 answer

✓ Accepted answer

I've never attempted this before, but I can imagine some uses! After some quick thought, this should solve your predicament:

local TextBox = script.Parent


TextBox.FocusLost:Connect(function(EnterPressed)
    if not (EnterPressed) then return end
    ---------------
    TextBox:CaptureFocus()
end)

3 comments

0

When I press enter, the text resets but i can still type inside of the box and clicking outside of the text box and clicking on it resets the text.

0

That's due to the ClearTextOnFocus boolean. Toggle it off; if you're trying to make a multi-line TextBox, there is already a built-in option to enable that feature within the TextBox's properties.

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.