Version

Handle Click Event

The following code shows you how to handle the client-side click event of WebImageButton™.

In HTML:

<igtxt:WebImageButton ID="WebImageButton1" runat="server">
	<ClientSideEvents Click="WebImageButton1_Click" />
</igtxt:WebImageButton>

In Javascript:

function WebImageButton1_Click(oButton, oEvent){
    // cancel click if it was triggered by Space key
    if (Event.action == 1)
        Event.cancel = true;
    // cancel click if it was triggered by Enter key
    if (Event.action == 2)
        Event.cancel = true;
    // cancel click if it was triggered by Access key
    if (Event.action == 3)
        Event.cancel = true;
    // cancel click if it was triggered by Mouse button
    if (Event.action == 0)
        return;
}