OnClick cant find the sub i'm calling

I'm building some html text to put on a window.
It works mostly as intended but a button I'm displaying - when clicked cant find the subroutine I'm calling. I just cant see what I've missed or doing wrong. Not sure if I need javascript? Thanks.

'OpenImage' is a subroutine on the server side. I pass this some variables.
'details' is the text string I'm creating.