Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


References

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

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB329156, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 329156
Revision : 4
Created on : 5/21/2007
Published on : 5/21/2007
Exists online : False
Views : 517