Show alerts conditionally with javascript

Is there a way to display alerts based on buttons pressed, so if I were to click approve the alert would be a green success alert, and if I click needs review, the alert would show as needs review with a blue alert. Thanks!

Hi Jason,

One way to do this would be to add two alerts, and use Event Handlers on the buttons to set a Temporary State. Then, using the Hidden property on the alerts, optionally choose which alert to show, i.e.:

-Event handler on the "Approve" button sets state1 to "approved" (and "Needs review sets it to "needs review"

-alert2 is set to hide when state1 = "approved" (and alert1 is set to hide when state1 = "needs review"

-Resulting in: