Form / Date Picker / Trigger

To handle live changes to a date picker, enable the trigger attribute.

from h2o_wave import main, app, Q, ui
async def serve(q: Q):
if not q.client.initialized:['example'] = ui.form_card(box='1 1 4 10', items=[
ui.date_picker(name='date_trigger', label='Pick a date', trigger=True),
q.client.initialized = True
else:['example'].items[0].text.content = f'Selected date: {q.args.date_trigger}'['example'].items[1].date_picker.value = q.args.date_trigger

Tags: โ€‚date_picker โ€‚form โ€‚trigger