Version

Change the Default Action of a Button

WebHtmlEditor’s™ BeforeAction client-side event contains an "act" parameter which allows you to get or set the action that WebHtmlEditor is about to perform related to the end user’s action. This is useful if you want to disable the default action or change the action.

The following JavaScript will change the default bold action to underline when the end user clicks the Bold button.

WebHtmlEditor Change the Default Action of a Button 01.png

In JavaScript:

function WebHtmlEditor1_BeforeAction
    (oEditor, actID, oEvent, p4, p5, p6, p7, p8, act){
	// If the action about to be performed is bold...
	if(act == "bold")
	{
	    // ...change the event's action to underline.
	    // change ‘underline’ to ‘none’ in order to
	    // disable the button.
	    oEvent.act = "underline";
	}
}