Thank you both for your replies.
The even is on Change and the form:ready event is
this.execEvent("change");
I am getting the app.alert dialog box, so I know it's getting there, but I am not getting anywhere else.
I tried using the code from S L Walker, inserting the "hidden" and "visible" lines in for my button and still nothing.
Any other ideas?