Is it possible to display a label when a certain number of characters are entered into a textedit?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cakee

I currently have a label hidden with hide(), however am unable to get a limit on the textedit or display the label when a limit is reached.

:bust_in_silhouette: Reply From: Wakatta

Yes it is possible

Connect the text_changed(new_text) signal of the lineEdit

func _on_LineEdit_text_changed(new_text):
    if new_text.length() == 5:
        $Label.show()
    else:
        $Label.hide()

Replacing the number 5 with your “certain number”