BUG: AutoComplete Does Not Work When You Use Script to Submit a Form

Exonerare de răspundere pentru conținutul retras din baza de cunoștințe

Acest articol a fost scris despre produsele pentru care Microsoft nu mai oferă asistență. Prin urmare, acest articol este oferit „ca atare” și nu mai va fi actualizat.

Symptoms

The AutoComplete feature does not work when you use script to submit a form. For example, AutoComplete may not function when you view Microsoft ASP.NET Web Forms that use postback to process events on controls other than the Submit button.


WORKAROUND

To work around this problem, explicitly save the form in the AutoComplete data store:

  1. Copy the following code to create an HTML page:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <SCRIPT>
    function subForm()
    {
    window.external.AutoCompleteSaveForm(f1);
    f1.submit();
    }
    </script>
    </HEAD>
    <BODY>
    <FORM id=f1>
    User ID : <input type=text name=id></input><br>
    Password :<input type=password name=pw></input><br>
    E-mail :<input type = text VCARD_NAME = "vCard.Email"> <br>
    <input type=button value=submit onclick="subForm()">
    </FORM>
    </BODY>
    </HTML>
  2. Fill in the correct information, and then click Submit.
  3. Revisit the page, and then type in a field that has the same name as a stored field. The AutoComplete attribute works; it provides an AutoComplete box that contains a list of previously-stored data.

Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

More Information

Steps to Reproduce the Behavior

  1. Copy the following code to create an HTML page:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <SCRIPT>
    function subForm()
    {
    f1.submit();
    }
    </script>
    </HEAD>
    <BODY>
    <FORM id=f1>
    User ID : <input type=text name=id></input><br>
    Password :<input type=password name=pw></input><br>
    E-mail :<input type = text VCARD_NAME = "vCard.Email"> <br>
    <input type=button value=submit onclick="subForm()">
    </FORM>
    </BODY>
    </HTML>
  2. Fill in the correct information, and then click Submit.
  3. Revisit the page, and then type in a field that has the same name as a stored field. The AutoComplete attribute does not work; it does not provide an AutoComplete box that contains a list of previously-stored data.

References

For more information about AutoCompleteSaveForm, visit the following Microsoft Web sites:

Proprietăți

ID articol: 329156 - Ultima examinare: 19 iun. 2014 - Revizie: 1

Feedback