TextBox not detecting text?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    For the textbox to detect if there is actual text in it and if it passes through ROBLOX’s text filter.

  2. What is the issue? Include screenshots / videos if possible!
    When text is entered or the text is changed it doesn’t detect it

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried to do a check if there is text in it also checking if the text has changed but neither has worked

(When using GetPropertyChangedSignal, it always detected the text being changed to “” when being cloned in)

1 Like

can you show us the code for this?

2 Likes

local NameSelector = script.NameSelector:Clone()
NameSelector.Parent = player.PlayerGui

	if NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox"):GetPropertyChangedSignal("Text")and NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").FocusLost then
		local success, err = pcall(function()
			local FilterText = TextService:FilterStringAsync(NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").Text, player.UserId)
			return
		end)

		if not success then 
			NameSelector:FindFirstChild("Frame"):FindFirstChild("Warning").Visible = true
			wait(2)
			NameSelector:FindFirstChild("Frame"):FindFirstChild("Warning").Visible = false
			return
		end
		
		if success and NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").Text ~= "" and NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").FocusLost then
			print("success")
			NameSelector:FindFirstChild("Frame"):FindFirstChild("Confirm").Visible = true
		end
		
		if NameSelector:FindFirstChild("Frame"):FindFirstChild("Confirm").MouseButton1Click and success then
			ReplicatedStorage:WaitForChild("Remotes").Events.SetDataKey:FireClient(player, "FirstName", NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").Text)
		end
	end
1 Like

did you manage to fix it or something

2 Likes

No, unfortunately. I accidentally pressed “Solution” If that is what you are talking about

2 Likes

alright you should unselect it because it looks like its solved

2 Likes

I have unselected it, it doesn’t show that there is a solution.

1 Like

some advice, you should use more variables, it looks quite cluttered and its kind of hard to make sense of and find any errors

1 Like

I was in a rush to get that step over with so I could continue onto other things. So sorry for the clutter

2 Likes

its ok
\\\\\\\\\\\\\\\\

1 Like

can you show the heirachy of every thing involved in the script? (the children of everything i mean)

1 Like

image
This?

1 Like

and replicated storage too

\\\

1 Like

image
I know that i have important events in here but I was using them for testing

1 Like

your issue is that you cant detect any text in the textbox correct?

1 Like

Yes, When I was testing that if there was text and to print it nothing was going through

1 Like

What’s your main goal? Usually to fetch textbox text you just use

TextBox.Changed:Connect(function(Property)
 if Property == "Text" then
    print(TextBox.Text)
  end
end)
-- or
print(TextBox.Text)
1 Like
print(NameSelector:FindFirstChild("Frame"):FindFirstChild("TextBox").Text)

this prints nothing?

1 Like

If your code is a server script (aka not a localscript) it won’t detect change from the textbox because changes to the text within the textbox is made on the client. It also depends on where the textbox is. If it is a screen GUI it is relatively simple, but if it is on a billboard GUI or a surface GUI, the billboard/surface GUI has to be located within screen GUI and adornee’d to the part in order for you to register anything. Also, I’m like 50% sure that the roblox text filter doesn’t work in studio, might have to double check.

2 Likes

Yep, you’re right it doesn’t work in Studio. Tested it myself a couple of weeks ago.

That is also true.


You should check if the text has changed on the client like this:

TextBox.Changed:Connect(function(property)
if property == “Text” then
RE:FireServer(TextBox.Text)
end
end)

Or like this (my preferred way):

TextBox:GetPropertyChangedSignal(“Text”):Connect(function()
RE:FireServer(TextBox.Text)
end)

However, if you’re taking this into account:

That’s gonna be a while another mess for you.

2 Likes