Invalid call. Nonexistent function 'get_txt' in base 'LineEdit'.

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

i get this error Invalid call. Nonexistent function ‘get_txt’ in base ‘LineEdit’.
func _on_Confirm_pressed():
if username_input.get_txt() == “”:
print(“valid username”)
elif userpassword_input.get_txt() == “”:
print(“valid password”)
elif userpassword_repeat_input.get_txt() == “”:
print(“valid password”)
elif userpassword_repeat_input.get_txt() != userpassword_repeat_input.get_txt():
print(“password i”)
elif userpassword_input.get_txt().lenght() <=6:
print("7 )
confirm_button.disabled = true
back_button.disabled = true
var username = username_input.get_txt()
var password = userpassword_input.get_txt()
Gateway.ConnectToServer(username, password, true)


:bust_in_silhouette: Reply From: jgodfrey

The getter method is get_text(), not get_txt(). Or, you can just use the text property…

thanks and i have one more question

elif cr_userpassword_input.get_txt().lenght() <=6:

this line i get error
Invalid call. Nonexistent function ‘lenght’ in base ‘String’.

joleera | 2022-04-11 21:06

Accurate spelling is really important in programming. It can’t just be close…

In this case, it’s length(), not lenght()

jgodfrey | 2022-04-11 21:18

this new language for me
thank you

joleera | 2022-04-11 21:26