You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often have forms where some questions do not make sense if a question was answered in a specific way before. For example, on a feedback form to an invitation, we ask if the invitee will attend the event (a required bool field), and if they attend, we ask how many guests they will bring with them (an optional int field):
fromtypingimportAnnotated, OptionalfrompydanticimportBaseModel, FieldfromfastuiimportcomponentsascclassFeedback(BaseModel):
attendance: Annotated[bool, Field(title='I will attend the ceremony.')]
attendees_count: Annotated[Optional[int], Field(title='I will be accompanied by (max 5) additional guest(s).')] =Nonec.ModelForm(submit_url='./answer', model=Feedback)
Is it possible to disable/enable or maybe even hide/unhide form element attendees_count depending on the value of attendance?
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for this great tool.
We often have forms where some questions do not make sense if a question was answered in a specific way before. For example, on a feedback form to an invitation, we ask if the invitee will attend the event (a required
bool
field), and if they attend, we ask how many guests they will bring with them (an optionalint
field):Is it possible to disable/enable or maybe even hide/unhide form element
attendees_count
depending on the value ofattendance
?The text was updated successfully, but these errors were encountered: