Dear Forum members
I am stuck building a website which aims to display some research data. I have an alert that displays a form containing buttons and related images. When a button is clicked it displays the related image in an image box on the main page. I want this click event to also trigger closing the alert. Is this possible?
This is what I have tried and is part of the code for the form that is shown in the alert:
def handle_click(self, **event_args):
# Get the species name from the text of the button that was clicked
clicked_species = event_args['sender'].text
# Raise the event
self.raise_event('x-species-clicked', species=clicked_species)
# Close the alert
anvil.alert.close(clicked_species, dismissible=true)
Many thanks
S