Greetings, guys. I’m building an app and I use a form on it. After user filling the form, I would like to remove it from the screen (remove email, senha and login_button from the screen). Anyone has an idea about how to do that???
with st.form(“login”):
st.markdown("#### Painel de Login")
email = st.text_input(“Email”, placeholder = “Digite aqui seu email”)
senha = st.text_input(“Senha”, placeholder = “Digite aqui sua senha”, type = “password”)
login_button = st.form_submit_button(“Login”)
You could use st.empty() to insert a container, create a form with the container, and call the .empty() method on the container to remove the form once the submit button is clicked:
import streamlit as st
placeholder = st.empty()
with placeholder.form("login"):
st.markdown("#### Painel de Login")
email = st.text_input("Email", placeholder="Digite aqui seu email")
senha = st.text_input("Senha", placeholder="Digite aqui sua senha", type="password")
login_button = st.form_submit_button("Login")
if login_button:
placeholder.empty()