Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textarea Component FastHTML #532

Open
jgburd79 opened this issue Oct 19, 2024 · 2 comments
Open

Textarea Component FastHTML #532

jgburd79 opened this issue Oct 19, 2024 · 2 comments

Comments

@jgburd79
Copy link

How to fill in value for Textarea component?

Let's assume we have a form

form = Form(
Textarea(id="mytextarea", name="mytextarea", value=Item.text)
)

This does not seam to work in populating a Textarea like you can do for an Input by using the value parameter.

@jgburd79 jgburd79 changed the title Textarea Component Textarea Component FastHTML Oct 19, 2024
@timcol
Copy link
Contributor

timcol commented Oct 20, 2024

Passing the value as a child element might be what you're after.

Form(Textarea(item.text, id="mytextarea", name="mytextarea"))

results in a Textarea nested in a Form pre-populated with item.text

@jgburd79
Copy link
Author

jgburd79 commented Oct 20, 2024

@timcol,
That was exactly it. Simple, but not very intuative. I assumed that I could only use keywords. Nut, it does make sense since the actual text in Textareas in HTML can only be input in between the tags and not as parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants