How would i check to see if all textboxes in a frame contain text?

So I’ve been getting all of the textboxes by using a for loop and using :IsA(“TextBox”).
But I can’t seem to figure out to check if those all include text I don’t know if I explained it right.

script.Parent.TextButton.MouseButton1Click:Connect(function()
--- check if all the textboxes are filled with text

--continue script
end)
local TextBoxHolder = Frame --put the object that holds your textboxes here
script.Parent.TextButton.MouseButton1Click:Connect(function()
 allContainText = true
 for i,v in pairs(TextBoxHolder:GetChildren()) do
  if v:IsA("TextBox") then
   local text = v.Text:gsub(" ","") --clear whitespace so it doesn't count as a string if it is just spaces
   if text ~= "" then --check if there is text in this box
    --all good
   else
    --no text!
    allContainText = false
   end
  end
 end
 if allContainText == true then
  --run your code that should be run if ALL textboxes are full
 end
end)

Hope I helped! If not, reply with any issues, and if I did, please mark me as a solution. Thanks!

1 Like

Thank you so much!
30 char gang

1 Like