Prevent page from refreshing with multiple buttons

I am building a movie recommendation system that generates similar movies. For each movie, there is a “save” button which will record the user’s selection and then print out a list at the end. Is it possible to prevent the page from refreshing and generating a different list of movies when any one of these buttons is clicked?
Thanks!

Hi @yu1929

Yes, you can achieve this by encapsulating all your input widgets inside an st.form

Please see this Docs page for more information:

This would allow users to make all widget selection and finally click on a submit button to process the input.

Hope this helps!