-
I would like to pass the value(true/false) and the text of a checkbox into a function but I haven't been able to figure out how to capture the text. What I am trying to is, if checkbox is false, remove the text of the checkbox from a list. If the checkbox is true, add the text back into the list. |
Beta Was this translation helpful? Give feedback.
Answered by
rodja
Feb 10, 2023
Replies: 1 comment 2 replies
-
The ValueChangeEventArguments contain the sender and the value: from nicegui import ui, events
async def check(event: events.ValueChangeEventArguments):
event.sender.set_text('Checked' if event.value else '')
ui.checkbox(value=False, on_change=check)
ui.run() |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rodja
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ValueChangeEventArguments contain the sender and the value: