You are here: Reference > JavaScript > client-side > browser > methods > AutoCompleteSaveForm (external)

AutoCompleteSaveForm method (external)

Browser support:
Stores the values and names of the named input:password and input:text elements in the specified form for autocompletion.
This method stores the name/value pairs only if Autocomplete windows are enable in Internet Explorer (Tools / Internet Options / Content / Autocomplete - Settings). If Autocomplete is enabled, the AutoCompleteSaveForm method stores the name/value pairs on the local machine of the user. The next time when the user starts to type in a named input:password or input:text field, the browser displays suggestions based on the values stored for the name of the field. The stored data is independent of the location of the document, only the values and names of the named elements are stored.
When the user submits a form, the values and names of the named input:password and input:text elements are stored for autocompletion similarly to the AutoCompleteSaveForm method, although it can be turned off by the autocomplete property. The AutoCompleteSaveForm can be used to save the name/value pairs without sending a form.

Syntax:

object.AutoCompleteSaveForm (formElement);
You can find the related objects in the Supported by objects section below.

Parameters:

formElement
Required. References to a form object to store for autocompletion.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the AutoCompleteSaveForm method.
<head>
    <script type="text/javascript">
        function SaveForAutocomplete () {
            if (window.external && ('AutoCompleteSaveForm' in window.external)) {
                var form = document.getElementById ("myForm");
                window.external.AutoCompleteSaveForm (form);
            }
            else {
                alert ("Your browser does not support this example!");
            }
        }
    </script>
</head>
<body>
    <div>This example works only if Autocomplete is enabled in your browser!</div>

    Type some text in the input field and store it with the button below.
    When you start to type a word that matches one or more of the stored values,
    then suggestions will be displayed.
    <form id="myForm">
        <input type="text" name="myInput"/>
    </form>
    <button onclick="SaveForAutocomplete ()">Store for autocompletion!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content