Skip to content

handling input values without using form #602

Answered by acivitillo
acivitillo asked this question in Question
Discussion options

You must be logged in to vote

ok I figured it out, we need to update the state as we type, this means we need to call a function to set the value state onChange, check the 2 lines I added below. Question, how does this look like performance wise? We are hitting the server with a lot of events now, I guess this is why we are using websockets?

html.input(
            {
                "type": "text",
                "placeholder": "Your message...",
                "value": email, #this
                "onChange": lambda event: set_email(event["target"]["value"]), #< and this
            }
),

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rmorshea
Comment options

@rmorshea
Comment options

@acivitillo
Comment options

@rmorshea
Comment options

Answer selected by rmorshea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants