Skip to content
Discussion options

You must be logged in to vote

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)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Haadi-A
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants