mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #4] How can I get the value of form's element? #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mostafa-asg on GitHub (Jan 10, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/4
Hi
First of all, thanks for your great work.
In the data entry form sample, How can I get the values of form?
For example in Save button, how can I get the value of first name input field?
@rivo commented on GitHub (Jan 10, 2018):
You're right, this was missing. I don't have form element IDs so it doesn't quite work as in your example. But you now have two options:
(1) Added a change event listener to the input field in the form:
(2) You get the field directly (by its index) and call its getter (requires a cast, though):
@mostafa-asg commented on GitHub (Jan 10, 2018):
Thank you
@rivo commented on GitHub (Jan 13, 2018):
Please note that I've just committed a change which renames
GetElement()toGetFormItem()for consistency reasons. I hope this won't cause too much trouble.