The following are client-side events supported by the WebImageButton control.
Initialize
Fires when the WebImageButton is initialized. It can be used to customize its appearance and behavior and cannot be canceled.
Parameters
Button
Reference to the JavaScript object that represents WebImageButton.
Remarks
The following example shows the event being used.
function initializeInEdit(Button) { alert("Init Button: " + Button.getUniqueID()); }
Click
Fires before the control is clicked by the mouse or a key (this event can be canceled).
Reference to the JavaScript object that represents WebImageButton. Event
Reference to the ig_EventObject object Event.action
action that triggered click. Possible values.
0 - Mouse button
1 - Space key
2 - Enter key
3 - AccessKey
function clickWebImageButton(Button, Event) { if(Event.action == 1) Event.cancel = true; }
Paint
Fires after the control is repainted (can be used to customize the appearance of a button dynamically).
Reference to the ig_EventObject object
function paintWebImageButton(oButton, Event) { if(Button.getState() == 4) italic = "italic"; var span = Button.getElementAt(3); span.style.fontStyle = italic; }
KeyDown
Fires when the control receives the keydown event of a browser (this event can be canceled).
function keyDownWebImageButton(Button, Event) { window.status = "KeyDown for " + Button.getClientID() + " " + Event.event.keyCode; }
KeyUp
Fires when the control receives the keyup event of a browser.
function keyUpWebImageButton(Button, Event) { window.status = "KeyUp for " + Button.getClientID() + " " + Event.event.keyCode; }
Focus
Fires when the control receives the focus event of a browser.
function focusWebImageButton(Button, Event) { window.status = "Focus for " + Button.getClientID(); }
Blur
Fires when the control receives the blur event of a browser.
MouseDown
Fires when the control receives the mousedown event of a browser.
function mouseDownWebImageButton(Button, Event) { window.status = "MouseDown for " + Button.getClientID(); }
MouseUp
Fires when the control receives the mouseup event of a browser.
function mouseUpWebImageButton(Button, Event) { window.status = "MouseUp for " + Button.getClientID(); }
MouseMove
Fires when the control receives the mousemove event of a browser.
function mouseMoveWebImageButton(Button, Event) { window.status = "MouseMove for " + Button.getClientID(); }
MouseOut
Fires when the mouse is moved outside the bounds of a control (event may not match with events of a browser).
function mouseOutWebImageButton(Button, Event) { window.status = "MouseOut for " + Button.getClientID(); }
MouseOver
Fires when the mouse is moved inside the bounds of a control.
That event may not match with events of a browser.
function mouseOverWebImageButton(Button, Event) { window.status = "MouseOver for " + Button.getClientID(); }