Skip to content
Related Articles

Related Articles InPlaceEditor cancelText Option
  • Last Updated : 23 Dec, 2020

The library is a cross-browser library that aims at improving the user interface of a website. The Ajax.InPlaceEditor is used to make elements editable thereby allowing the user to edit the content on the page and submit the changes to the server.

The InPlaceEditor cancelText option is used to specify the text of the link that cancels the editing and closes the editor. The default string value of the option is “cancel”.


{ cancelText : string }

Value: This option has a single value as mentioned above and described below:

  • string: This is a string that specifies the text to be shown for the link used to cancel the edit. The default string is “cancel”.

The below example illustrates the use of this option.

Example: The below HTML file demonstrates the InPlaceEditor cancelText Option example.


<!DOCTYPE html>
    <script type="text/javascript"
    <script type="text/javascript"
        src="scriptaculous.js?load = controls">
    <script type="text/javascript">
        window.onload = function () {
            // Default InPlaceEditor with no
            // options
            new Ajax.InPlaceEditor(
            // InPlaceEditor where the
            // cancelText option is modified
            new Ajax.InPlaceEditor(
                    // Specify the text to be used for
                    // the link to cancel the edit
                    cancelText: "Press to cancel!"
    <h1 style="color: green">
    <h2>InPlaceEditor cancelText Option</h2>
        The "cancelText" option is used to
        specify the text to be shown for the
        cancel option of the editor.
        This element has the cancelText
        as the default one.
    <div id="editableElement">
        Click this element to edit it!
        This element has the cancelText
        set to a custom value.
    <div id="editableElement2">
        Click this element to edit it!

The below PHP file demonstrates this example:


  if( isset($_REQUEST["value"]) ) {
    $str = $_REQUEST["value"];
    echo $str;



My Personal Notes arrow_drop_up
Recommended Articles
Page :