HiddenInput
This element is used for hidden input data that should not be visible to the user.
But it will be sent back to the server when the form is submitted.
Example:
:type name: str
:type value: Any
HiddenInput
This element is used for hidden input data that should not be visible to the user.
But it will be sent back to the server when the form is submitted.
Example:
:type name: str
:type value: Any
from uiwiz import ui
from pydantic import BaseModel
class HiddenInputExample(BaseModel):
csrf_token: str
age: int
@app.ui("/ui/hiddeninput/submit")
async def ui_hiddeninput_submit(data_input: HiddenInputExample):
with ui.toast().set_auto_close(False).success():
ui.dict(data_input.dict()).border_classes("")
with ui.form().on_submit(ui_hiddeninput_submit):
ui.hiddenInput(name="csrf_token", value="hidden_csrf_token")
ui.input("age", None, "Enter your age")
ui.button("Submit")