Is it possible to have multiple rick text fields in the same Alert?

What I’m trying to do:

I am trying to display multiple pieces of content in the same Alert, in separate RickText fields. Is it possible to have more than one such field in the same Alert? When I tried, the second field did not show up.

What I’ve tried and what’s not working:
As per the code below, I tried adding a second “content” argument to the alert, but that does not show up.

Code Sample:

    result = alert(content=TA,
                   content2 = RichText(content="res_text"),
               title="An important choice",
               large=True,
               buttons=[
                 ("Yes", "YES"),
                 ("No", "NO"),
                 ("Neither", None)
               ]) ``` 

Clone link:
share a copy of your app

You have two main options (which are really both the same):

  1. Create a Form that contains your two rich text fields, and then use an instance of that form as the content for an alert

  2. Use the custom component for alert2 which allows building the custom forms for alerts without actually building the custom forms: Input_box() and alert2() This is a convenience utility that’s pretty slick.

2 Likes