Skip to content
Related Articles

Related Articles

Improve Article InPlaceEditor okText 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 content on the page and submit the changes to the server.

The InPlaceEditor okText option is used to specify the text on the button used to save the changes and submit changes to the server. The default string is “ok”.


{ okText : 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 button used to submit the changes to the server. The default string is “ok”.

The below example illustrates the use of this option.


The below HTML file demonstrates this example:


    <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 with the
            // okText modified
            new Ajax.InPlaceEditor(
                    // Specify the text to be used for
                    // the button to submit changes
                    okText: "Click to confirm the edit"
    <h1 style="color: green">
    <h2>InPlaceEditor okText Option</h2>
        The "okText" option is used to specify
        the text to be shown for the OK option
        of the editor.
        This element has the okText as the
        default one.
    <div id="editableElement">
        Click this element to edit
        This element has the okText set to a
        custom value.
    <div id="editableElement2">
        Click this element to edit

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 :