TextField values not showing when passed to another function #907
-
I have TextField which take data and gives it to another function but the problem is when I pass the value of the TextField like txtfield.value to another function it shows the flet TextField object's location in memory like this: code structure is roughly like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hey, grab the code below which works: import flet as ft
def main(page: ft.Page):
def onButtonClicked(e):
print(txtFieldobj.value)
txtFieldobj = ft.TextField(
autofocus=True, label="Student's full name", width=250)
button = ft.Column(controls=[
ft.ElevatedButton(
text="Done", width=100, on_click=onButtonClicked),
], )
page.add(
ft.Column(controls=[txtFieldobj, button, ]
)
)
ft.app(target=main) |
Beta Was this translation helpful? Give feedback.
-
Thanks that helpful. |
Beta Was this translation helpful? Give feedback.
Hey, grab the code below which works: