onbeforecut event
Fires on the source object before the selection is deleted from the document.
Syntax
HTML Attribute | <element onbeforecut = "handler(event)"> |
Event Property | object.onbeforecut = handler; |
attachEvent Method | object.attachEvent("onbeforecut", handler) |
addEventListener Method | object.addEventListener("beforecut", handler, useCapture) |
Event information
Synchronous | No |
Bubbles | Yes |
Cancelable | Yes |
Event handler parameters
- pEvtObj [in]
Type: IHTMLEventObj
Standards information
There are no standards that apply here.
Remarks
Creating custom code for cutting requires several steps:
- Set event.returnValue=false in the HTMLInputTextElementEvents2::onbeforecut event to enable the Cut shortcut menu item.
- Specify a data format in which to transfer the selection through the IHTMLDataTransfer::setData method of the clipboardData object.
- Invoke the IHTMLDataTransfer::setData method in the HTMLInputTextElementEvents2::oncut event.
None.
To invoke this event, do one of the following:
- Right-click to display the shortcut menu and select Cut.
- Or press CTRL+X if the selection is within a text field.
The pEvtObj parameter is required for the following interfaces:
- HTMLAnchorEvents2
- HTMLAreaEvents2
- HTMLButtonElementEvents2
- HTMLControlElementEvents2
- HTMLDocumentEvents2
- HTMLElementEvents2
- HTMLFormElementEvents2
- HTMLImgEvents2
- HTMLFrameSiteEvents2
- HTMLInputFileElementEvents2
- HTMLInputImageEvents2
- HTMLInputTextElementEvents2
- HTMLLabelEvents2
- HTMLLinkElementEvents2
- HTMLMapEvents2
- HTMLMarqueeElementEvents2
- HTMLObjectElementEvents2
- HTMLOptionButtonElementEvents2
- HTMLScriptEvents2
- HTMLSelectElementEvents2
- HTMLStyleElementEvents2
- HTMLTableEvents2
- HTMLTextContainerEvents2
- HTMLWindowEvents2
See also
Reference
HTMLInputTextElementEvents2::onbeforecopy
HTMLInputTextElementEvents2::onbeforepaste
HTMLInputTextElementEvents2::oncut
HTMLInputTextElementEvents2::onpaste
Conceptual